diff options
author | tengs@chromium.org <tengs@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-31 00:52:51 +0000 |
---|---|---|
committer | tengs@chromium.org <tengs@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-31 00:52:51 +0000 |
commit | 64304a7356d23cbbe30cc7a61d2a63cc4de90990 (patch) | |
tree | e2a9e7017299d7b6b6e82b005e7c7c9d2f934cf4 /chrome/browser | |
parent | 08d469b27722f24233346b77477938b629ef7ae9 (diff) | |
download | chromium_src-64304a7356d23cbbe30cc7a61d2a63cc4de90990.zip chromium_src-64304a7356d23cbbe30cc7a61d2a63cc4de90990.tar.gz chromium_src-64304a7356d23cbbe30cc7a61d2a63cc4de90990.tar.bz2 |
Launch easy unlock setup app from chrome://settings.
BUG=347709
Review URL: https://codereview.chromium.org/211333005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@260479 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/prefs/browser_prefs.cc | 4 | ||||
-rw-r--r-- | chrome/browser/signin/easy_unlock.cc (renamed from chrome/browser/signin/easy_unlock_controller.cc) | 23 | ||||
-rw-r--r-- | chrome/browser/signin/easy_unlock.h | 24 | ||||
-rw-r--r-- | chrome/browser/signin/easy_unlock_controller.h | 18 | ||||
-rw-r--r-- | chrome/browser/ui/webui/options/browser_options_handler.cc | 3 |
5 files changed, 48 insertions, 24 deletions
diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc index f9cf121..fa6d8ad 100644 --- a/chrome/browser/prefs/browser_prefs.cc +++ b/chrome/browser/prefs/browser_prefs.cc @@ -69,7 +69,7 @@ #include "chrome/browser/search/search.h" #include "chrome/browser/search_engines/template_url_prepopulate_data.h" #include "chrome/browser/services/gcm/gcm_profile_service.h" -#include "chrome/browser/signin/easy_unlock_controller.h" +#include "chrome/browser/signin/easy_unlock.h" #include "chrome/browser/signin/signin_manager_factory.h" #include "chrome/browser/signin/signin_promo.h" #include "chrome/browser/task_manager/task_manager.h" @@ -350,7 +350,7 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) { chrome_browser_net::Predictor::RegisterProfilePrefs(registry); chrome_prefs::RegisterProfilePrefs(registry); DownloadPrefs::RegisterProfilePrefs(registry); - EasyUnlockController::RegisterProfilePrefs(registry); + easy_unlock::RegisterProfilePrefs(registry); extensions::ExtensionPrefs::RegisterProfilePrefs(registry); extensions::launch_util::RegisterProfilePrefs(registry); ExtensionWebUI::RegisterProfilePrefs(registry); diff --git a/chrome/browser/signin/easy_unlock_controller.cc b/chrome/browser/signin/easy_unlock.cc index d19a6d0..bf79edc 100644 --- a/chrome/browser/signin/easy_unlock_controller.cc +++ b/chrome/browser/signin/easy_unlock.cc @@ -2,14 +2,19 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/signin/easy_unlock_controller.h" +#include "chrome/browser/signin/easy_unlock.h" #include "base/values.h" +#include "chrome/browser/extensions/extension_service.h" +#include "chrome/browser/profiles/profile.h" +#include "chrome/browser/ui/extensions/application_launch.h" #include "chrome/common/pref_names.h" #include "components/user_prefs/pref_registry_syncable.h" +#include "extensions/browser/extension_system.h" -// static. -void EasyUnlockController::RegisterProfilePrefs( +namespace easy_unlock { + +void RegisterProfilePrefs( user_prefs::PrefRegistrySyncable* registry) { registry->RegisterBooleanPref( prefs::kEasyUnlockEnabled, @@ -24,3 +29,15 @@ void EasyUnlockController::RegisterProfilePrefs( new base::DictionaryValue(), user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); } + +void LaunchEasyUnlockSetup(Profile* profile) { + ExtensionService* service = + extensions::ExtensionSystem::Get(profile)->extension_service(); + const extensions::Extension* extension = + service->GetExtensionById(extension_misc::kEasyUnlockAppId, false); + + OpenApplication(AppLaunchParams( + profile, extension, extensions::LAUNCH_CONTAINER_WINDOW, NEW_WINDOW)); +} + +} // namespace easy_unlock diff --git a/chrome/browser/signin/easy_unlock.h b/chrome/browser/signin/easy_unlock.h new file mode 100644 index 0000000..48f9f0c --- /dev/null +++ b/chrome/browser/signin/easy_unlock.h @@ -0,0 +1,24 @@ +// Copyright 2014 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. + +#ifndef CHROME_BROWSER_SIGNIN_EASY_UNLOCK_H_ +#define CHROME_BROWSER_SIGNIN_EASY_UNLOCK_H_ + +namespace user_prefs { +class PrefRegistrySyncable; +} + +class Profile; + +namespace easy_unlock { + +// Registers Easy Unlock profile preferences. +void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); + +// Launches Easy Unlock Setup app. +void LaunchEasyUnlockSetup(Profile* profile); + +} // namespace easy_unlock + +#endif // CHROME_BROWSER_SIGNIN_EASY_UNLOCK_H_ diff --git a/chrome/browser/signin/easy_unlock_controller.h b/chrome/browser/signin/easy_unlock_controller.h deleted file mode 100644 index b9d53a9..0000000 --- a/chrome/browser/signin/easy_unlock_controller.h +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2014 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. - -#ifndef CHROME_BROWSER_SIGNIN_EASY_UNLOCK_CONTROLLER_H_ -#define CHROME_BROWSER_SIGNIN_EASY_UNLOCK_CONTROLLER_H_ - -namespace user_prefs { -class PrefRegistrySyncable; -} - -// Stub class for Easy Unlock features. -class EasyUnlockController { - public: - static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); -}; - -#endif // CHROME_BROWSER_SIGNIN_EASY_UNLOCK_CONTROLLER_H_ diff --git a/chrome/browser/ui/webui/options/browser_options_handler.cc b/chrome/browser/ui/webui/options/browser_options_handler.cc index b4a87c6..741b42b 100644 --- a/chrome/browser/ui/webui/options/browser_options_handler.cc +++ b/chrome/browser/ui/webui/options/browser_options_handler.cc @@ -51,6 +51,7 @@ #include "chrome/browser/search_engines/template_url.h" #include "chrome/browser/search_engines/template_url_service.h" #include "chrome/browser/search_engines/template_url_service_factory.h" +#include "chrome/browser/signin/easy_unlock.h" #include "chrome/browser/signin/signin_manager.h" #include "chrome/browser/signin/signin_manager_factory.h" #include "chrome/browser/sync/profile_sync_service.h" @@ -1630,7 +1631,7 @@ void BrowserOptionsHandler::HandleRequestHotwordAvailable( void BrowserOptionsHandler::HandleLaunchEasyUnlockSetup( const base::ListValue* args) { - // TODO(tengs): launch Easy Unlock setup flow. + easy_unlock::LaunchEasyUnlockSetup(Profile::FromWebUI(web_ui())); } void BrowserOptionsHandler::HandleRequestHotwordSetupRetry( |