summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortengs@chromium.org <tengs@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-31 00:52:51 +0000
committertengs@chromium.org <tengs@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-31 00:52:51 +0000
commit64304a7356d23cbbe30cc7a61d2a63cc4de90990 (patch)
treee2a9e7017299d7b6b6e82b005e7c7c9d2f934cf4
parent08d469b27722f24233346b77477938b629ef7ae9 (diff)
downloadchromium_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
-rw-r--r--chrome/browser/prefs/browser_prefs.cc4
-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.h24
-rw-r--r--chrome/browser/signin/easy_unlock_controller.h18
-rw-r--r--chrome/browser/ui/webui/options/browser_options_handler.cc3
-rw-r--r--chrome/chrome_browser.gypi4
-rw-r--r--chrome/common/extensions/extension_constants.cc1
-rw-r--r--chrome/common/extensions/extension_constants.h3
8 files changed, 54 insertions, 26 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(
diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi
index f629e66..810b3e3 100644
--- a/chrome/chrome_browser.gypi
+++ b/chrome/chrome_browser.gypi
@@ -2140,8 +2140,8 @@
'browser/signin/chrome_signin_client.h',
'browser/signin/chrome_signin_client_factory.cc',
'browser/signin/chrome_signin_client_factory.h',
- 'browser/signin/easy_unlock_controller.cc',
- 'browser/signin/easy_unlock_controller.h',
+ 'browser/signin/easy_unlock.cc',
+ 'browser/signin/easy_unlock.h',
'browser/signin/local_auth.cc',
'browser/signin/local_auth.h',
'browser/signin/principals_message_filter.cc',
diff --git a/chrome/common/extensions/extension_constants.cc b/chrome/common/extensions/extension_constants.cc
index 59aa13a..4bb93cb 100644
--- a/chrome/common/extensions/extension_constants.cc
+++ b/chrome/common/extensions/extension_constants.cc
@@ -100,6 +100,7 @@ namespace extension_misc {
const char kBookmarkManagerId[] = "eemcgdkfndhakfknompkggombfjjjeno";
const char kChromeAppId[] = "mgndgikekgjfcpckkfioiadnlibdjbkf";
const char kCloudPrintAppId[] = "mfehgcgbbipciphmccgaenjidiccnmng";
+const char kEasyUnlockAppId[] = "mkaemigholebcgchlkbankmihknojeak";
const char kEnterpriseWebStoreAppId[] = "afchcafgojfnemjkcbhfekplkmjaldaa";
const char kGmailAppId[] = "pjkljhegncpnkpknbcohdijeoejaedia";
const char kGoogleDocAppId[] = "aohghmighlieiainnegkcijnfilokake";
diff --git a/chrome/common/extensions/extension_constants.h b/chrome/common/extensions/extension_constants.h
index 7a9925b..1953665 100644
--- a/chrome/common/extensions/extension_constants.h
+++ b/chrome/common/extensions/extension_constants.h
@@ -80,6 +80,9 @@ namespace extension_misc {
// The extension id of the Cloud Print component application.
extern const char kCloudPrintAppId[];
+ // The extension id of the Easy Unlock component application.
+ extern const char kEasyUnlockAppId[];
+
// The extension id of the Enterprise Web Store component application.
extern const char kEnterpriseWebStoreAppId[];