OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/signin/easy_unlock_service_regular.h" | 5 #include "chrome/browser/signin/easy_unlock_service_regular.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/metrics/field_trial.h" | 9 #include "base/metrics/field_trial.h" |
10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
11 #include "base/prefs/scoped_user_pref_update.h" | 11 #include "base/prefs/scoped_user_pref_update.h" |
12 #include "base/values.h" | 12 #include "base/values.h" |
13 #include "chrome/browser/extensions/extension_service.h" | 13 #include "chrome/browser/extensions/extension_service.h" |
14 #include "chrome/browser/profiles/profile.h" | 14 #include "chrome/browser/profiles/profile.h" |
15 #include "chrome/browser/signin/easy_unlock_toggle_flow.h" | 15 #include "chrome/browser/signin/easy_unlock_toggle_flow.h" |
16 #include "chrome/browser/signin/screenlock_bridge.h" | 16 #include "chrome/browser/signin/screenlock_bridge.h" |
| 17 #include "chrome/browser/ui/extensions/app_launch_params.h" |
17 #include "chrome/browser/ui/extensions/application_launch.h" | 18 #include "chrome/browser/ui/extensions/application_launch.h" |
18 #include "chrome/common/extensions/extension_constants.h" | 19 #include "chrome/common/extensions/extension_constants.h" |
19 #include "chrome/common/pref_names.h" | 20 #include "chrome/common/pref_names.h" |
20 #include "components/pref_registry/pref_registry_syncable.h" | 21 #include "components/pref_registry/pref_registry_syncable.h" |
21 #include "content/public/browser/browser_thread.h" | 22 #include "content/public/browser/browser_thread.h" |
22 #include "extensions/browser/extension_system.h" | 23 #include "extensions/browser/extension_system.h" |
| 24 #include "extensions/common/constants.h" |
23 | 25 |
24 #if defined(OS_CHROMEOS) | 26 #if defined(OS_CHROMEOS) |
25 #include "apps/app_lifetime_monitor_factory.h" | 27 #include "apps/app_lifetime_monitor_factory.h" |
26 #include "base/thread_task_runner_handle.h" | 28 #include "base/thread_task_runner_handle.h" |
27 #include "chrome/browser/chromeos/login/easy_unlock/easy_unlock_key_manager.h" | 29 #include "chrome/browser/chromeos/login/easy_unlock/easy_unlock_key_manager.h" |
28 #include "chrome/browser/chromeos/login/easy_unlock/easy_unlock_reauth.h" | 30 #include "chrome/browser/chromeos/login/easy_unlock/easy_unlock_reauth.h" |
29 #include "chrome/browser/chromeos/login/session/user_session_manager.h" | 31 #include "chrome/browser/chromeos/login/session/user_session_manager.h" |
30 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 32 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
31 #include "components/user_manager/user_manager.h" | 33 #include "components/user_manager/user_manager.h" |
32 #endif | 34 #endif |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 CheckCryptohomeKeysAndMaybeHardlock(); | 108 CheckCryptohomeKeysAndMaybeHardlock(); |
107 } | 109 } |
108 #endif | 110 #endif |
109 | 111 |
110 void EasyUnlockServiceRegular::OpenSetupApp() { | 112 void EasyUnlockServiceRegular::OpenSetupApp() { |
111 ExtensionService* service = | 113 ExtensionService* service = |
112 extensions::ExtensionSystem::Get(profile())->extension_service(); | 114 extensions::ExtensionSystem::Get(profile())->extension_service(); |
113 const extensions::Extension* extension = | 115 const extensions::Extension* extension = |
114 service->GetExtensionById(extension_misc::kEasyUnlockAppId, false); | 116 service->GetExtensionById(extension_misc::kEasyUnlockAppId, false); |
115 | 117 |
116 OpenApplication(AppLaunchParams( | 118 OpenApplication( |
117 profile(), extension, extensions::LAUNCH_CONTAINER_WINDOW, NEW_WINDOW)); | 119 AppLaunchParams(profile(), extension, extensions::LAUNCH_CONTAINER_WINDOW, |
| 120 NEW_WINDOW, extensions::SOURCE_CHROME_INTERNAL)); |
118 } | 121 } |
119 | 122 |
120 const base::DictionaryValue* EasyUnlockServiceRegular::GetPermitAccess() const { | 123 const base::DictionaryValue* EasyUnlockServiceRegular::GetPermitAccess() const { |
121 const base::DictionaryValue* pairing_dict = | 124 const base::DictionaryValue* pairing_dict = |
122 profile()->GetPrefs()->GetDictionary(prefs::kEasyUnlockPairing); | 125 profile()->GetPrefs()->GetDictionary(prefs::kEasyUnlockPairing); |
123 const base::DictionaryValue* permit_dict = NULL; | 126 const base::DictionaryValue* permit_dict = NULL; |
124 if (pairing_dict && | 127 if (pairing_dict && |
125 pairing_dict->GetDictionary(kKeyPermitAccess, &permit_dict)) | 128 pairing_dict->GetDictionary(kKeyPermitAccess, &permit_dict)) |
126 return permit_dict; | 129 return permit_dict; |
127 | 130 |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 | 309 |
307 if (!success) { | 310 if (!success) { |
308 SetTurnOffFlowStatus(FAIL); | 311 SetTurnOffFlowStatus(FAIL); |
309 return; | 312 return; |
310 } | 313 } |
311 | 314 |
312 ClearRemoteDevices(); | 315 ClearRemoteDevices(); |
313 SetTurnOffFlowStatus(IDLE); | 316 SetTurnOffFlowStatus(IDLE); |
314 ReloadApp(); | 317 ReloadApp(); |
315 } | 318 } |
OLD | NEW |