Skip to content

Commit

Permalink
Merge pull request #88 from brave/fix-oscrypt-patch-errors-on-linux
Browse files Browse the repository at this point in the history
Fix Linux compilation errors
  • Loading branch information
AlexeyBarabash authored Apr 10, 2018
2 parents 1377f77 + d1d2d78 commit 16f184e
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 4 deletions.
4 changes: 2 additions & 2 deletions patches/components-os_crypt-key_storage_keyring.cc.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/components/os_crypt/key_storage_keyring.cc b/components/os_crypt/key_storage_keyring.cc
index af2f64b34ddb8e49d72dd0dd22ffd2418a422efb..4de119827b80cb8bbf83c26ef4937c6d8218e448 100644
index af2f64b34ddb8e49d72dd0dd22ffd2418a422efb..9db6e47b35e6cac14168908a4385120fe44cb8d0 100644
--- a/components/os_crypt/key_storage_keyring.cc
+++ b/components/os_crypt/key_storage_keyring.cc
@@ -6,6 +6,7 @@
Expand All @@ -24,7 +24,7 @@ index af2f64b34ddb8e49d72dd0dd22ffd2418a422efb..4de119827b80cb8bbf83c26ef4937c6d
std::string password;
gchar* password_c = nullptr;
+ const char* application_name;
+ base::CommandLine* command_line = base::CommandLine()::ForCurrentProcess();
+ base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
+ if (command_line->HasSwitch("import-chrome")) {
+ application_name = "chrome";
+ } else if (command_line->HasSwitch("import-chromium")) {
Expand Down
4 changes: 2 additions & 2 deletions patches/components-os_crypt-key_storage_kwallet.cc.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/components/os_crypt/key_storage_kwallet.cc b/components/os_crypt/key_storage_kwallet.cc
index aa4b3d4a6b5c7b1f725d6446ea5e573094ec935b..3d53b65e81969d7bc88466e09623eab22f3088cd 100644
index aa4b3d4a6b5c7b1f725d6446ea5e573094ec935b..4c4c7191a57afc7a42dfa87701578bd99d417d94 100644
--- a/components/os_crypt/key_storage_kwallet.cc
+++ b/components/os_crypt/key_storage_kwallet.cc
@@ -7,6 +7,7 @@
Expand All @@ -18,7 +18,7 @@ index aa4b3d4a6b5c7b1f725d6446ea5e573094ec935b..3d53b65e81969d7bc88466e09623eab2
+ base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
+ if (command_line->HasSwitch("import-chrome")) {
+ folder_name = "Chrome Keys";
+ key = "Chrome Safe Storage"
+ key = "Chrome Safe Storage";
+ } else if (command_line->HasSwitch("import-chromium")) {
+ folder_name = "Chromium Keys";
+ key = "Chromium Safe Storage";
Expand Down
13 changes: 13 additions & 0 deletions utility/BUILD.gn
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import("//build/config/features.gni")
import("//build/config/ui.gni")

source_set("utility") {
sources = [
Expand All @@ -9,6 +10,18 @@ source_set("utility") {
]

public_deps = [
"//content/public/common",
]

defines = [ ]

deps = [
"//chrome/common",
"//chrome/utility",
]

if (use_glib) {
defines += [ "USE_LIBSECRET" ]
deps += [ "//third_party/libsecret" ]
}
}
18 changes: 18 additions & 0 deletions utility/importer/chrome_importer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,24 @@
#include "sql/statement.h"
#include "url/gurl.h"

#if defined(OS_LINUX)
#include "components/os_crypt/key_storage_config_linux.h"
#endif

#if defined(USE_X11)
#if defined(USE_LIBSECRET)
#include "chrome/browser/password_manager/native_backend_libsecret.h"
#endif
#include "chrome/browser/password_manager/native_backend_kwallet_x.h"
#include "chrome/browser/password_manager/password_store_x.h"
#include "components/os_crypt/key_storage_util_linux.h"

base::nix::DesktopEnvironment ChromeImporter::GetDesktopEnvironment() {
std::unique_ptr<base::Environment> env(base::Environment::Create());
return base::nix::GetDesktopEnvironment(env.get());
}
#endif

ChromeImporter::ChromeImporter() {
}

Expand Down

0 comments on commit 16f184e

Please sign in to comment.