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

Unified Diff: ios/chrome/browser/passwords/ios_chrome_password_manager_setting_migrator_service_factory.cc

Issue 1422713011: [Smart Lock, prefs reconciliation] IOS factory (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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
Index: ios/chrome/browser/passwords/ios_chrome_password_manager_setting_migrator_service_factory.cc
diff --git a/ios/chrome/browser/passwords/ios_chrome_password_manager_setting_migrator_service_factory.cc b/ios/chrome/browser/passwords/ios_chrome_password_manager_setting_migrator_service_factory.cc
new file mode 100644
index 0000000000000000000000000000000000000000..bda781e083c81d579d74080faebaf37ae8052419
--- /dev/null
+++ b/ios/chrome/browser/passwords/ios_chrome_password_manager_setting_migrator_service_factory.cc
@@ -0,0 +1,52 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ios/chrome/browser/passwords/ios_chrome_password_manager_setting_migrator_service_factory.h"
+
+#include "base/memory/singleton.h"
+#include "components/keyed_service/ios/browser_state_dependency_manager.h"
+#include "components/password_manager/sync/browser/password_manager_setting_migrator_service.h"
+#include "components/sync_driver/sync_service.h"
+#include "ios/chrome/browser/browser_state/browser_state_otr_helper.h"
+#include "ios/public/provider/chrome/browser/browser_state/chrome_browser_state.h"
+
+// static
+password_manager::PasswordManagerSettingMigratorService*
+IOSChromePasswordManagerSettingMigratorServiceFactory::GetForBrowserState(
+ ios::ChromeBrowserState* browser_state) {
+ return static_cast<password_manager::PasswordManagerSettingMigratorService*>(
+ GetInstance()->GetServiceForBrowserState(browser_state, true));
+}
+
+// static
+IOSChromePasswordManagerSettingMigratorServiceFactory*
+IOSChromePasswordManagerSettingMigratorServiceFactory::GetInstance() {
+ return base::Singleton<
+ IOSChromePasswordManagerSettingMigratorServiceFactory>::get();
+}
+
+IOSChromePasswordManagerSettingMigratorServiceFactory::
+ IOSChromePasswordManagerSettingMigratorServiceFactory()
+ : BrowserStateKeyedServiceFactory(
+ "PasswordManagerSettingMigratorService",
+ BrowserStateDependencyManager::GetInstance()) {}
+
+IOSChromePasswordManagerSettingMigratorServiceFactory::
+ ~IOSChromePasswordManagerSettingMigratorServiceFactory() {}
+
+scoped_ptr<KeyedService>
+IOSChromePasswordManagerSettingMigratorServiceFactory::BuildServiceInstanceFor(
+ web::BrowserState* context) const {
+ ios::ChromeBrowserState* browser_state =
+ ios::ChromeBrowserState::FromBrowserState(context);
+ return make_scoped_ptr(
+ new password_manager::PasswordManagerSettingMigratorService(
+ browser_state->GetSyncablePrefs()));
+}
+
+web::BrowserState*
+IOSChromePasswordManagerSettingMigratorServiceFactory::GetBrowserStateToUse(
+ web::BrowserState* context) const {
+ return GetBrowserStateRedirectedInIncognito(context);
+}
« no previous file with comments | « ios/chrome/browser/passwords/ios_chrome_password_manager_setting_migrator_service_factory.h ('k') | ios/chrome/ios_chrome.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698