Commit 64304a73 authored by tengs@chromium.org's avatar tengs@chromium.org

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
parent 08d469b2
......@@ -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);
......
......@@ -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
......@@ -2,17 +2,23 @@
// 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_
#ifndef CHROME_BROWSER_SIGNIN_EASY_UNLOCK_H_
#define CHROME_BROWSER_SIGNIN_EASY_UNLOCK_H_
namespace user_prefs {
class PrefRegistrySyncable;
}
// Stub class for Easy Unlock features.
class EasyUnlockController {
public:
static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry);
};
class Profile;
#endif // CHROME_BROWSER_SIGNIN_EASY_UNLOCK_CONTROLLER_H_
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_
......@@ -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(
......
......@@ -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',
......
......@@ -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";
......
......@@ -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[];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment