Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(514)

Unified Diff: chrome/browser/password_manager/password_store_factory.cc

Issue 2948783002: Create setting that disables password stores (Closed)
Patch Set: nits + tests Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/chrome_browser_main_linux.cc ('k') | chrome/common/chrome_switches.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/password_manager/password_store_factory.cc
diff --git a/chrome/browser/password_manager/password_store_factory.cc b/chrome/browser/password_manager/password_store_factory.cc
index 808fc9fd3815dc84a09fc51e1bfc65fa660e5efd..9c33a7a6bcae6b010b6166070a37b0725dfbd4e0 100644
--- a/chrome/browser/password_manager/password_store_factory.cc
+++ b/chrome/browser/password_manager/password_store_factory.cc
@@ -21,6 +21,7 @@
#include "chrome/browser/sync/glue/sync_start_util.h"
#include "chrome/browser/sync/profile_sync_service_factory.h"
#include "chrome/browser/web_data_service_factory.h"
+#include "chrome/common/chrome_paths_internal.h"
#include "chrome/common/chrome_switches.h"
#include "components/browser_sync/profile_sync_service.h"
#include "components/keyed_service/content/browser_context_dependency_manager.h"
@@ -196,8 +197,17 @@ PasswordStoreFactory::BuildServiceInstanceFor(
PrefService* prefs = profile->GetPrefs();
LocalProfileId id = GetLocalProfileId(prefs);
+ bool use_preference = base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableEncryptionSelection);
+ bool use_backend = true;
+ if (use_preference) {
+ base::FilePath user_data_dir;
+ chrome::GetDefaultUserDataDirectory(&user_data_dir);
+ use_backend = os_crypt::GetBackendUse(user_data_dir);
+ }
+
os_crypt::SelectedLinuxBackend selected_backend =
- os_crypt::SelectBackend(store_type, desktop_env);
+ os_crypt::SelectBackend(store_type, use_backend, desktop_env);
std::unique_ptr<PasswordStoreX::NativeBackend> backend;
if (selected_backend == os_crypt::SelectedLinuxBackend::KWALLET ||
« no previous file with comments | « chrome/browser/chrome_browser_main_linux.cc ('k') | chrome/common/chrome_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698