OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_app_manager.h" | 5 #include "chrome/browser/signin/easy_unlock_app_manager.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "build/build_config.h" | 12 #include "build/build_config.h" |
13 #include "chrome/browser/extensions/api/screenlock_private/screenlock_private_ap
i.h" | 13 #include "chrome/browser/extensions/api/screenlock_private/screenlock_private_ap
i.h" |
14 #include "chrome/browser/extensions/component_loader.h" | 14 #include "chrome/browser/extensions/component_loader.h" |
15 #include "chrome/browser/extensions/extension_service.h" | 15 #include "chrome/browser/extensions/extension_service.h" |
16 #include "chrome/browser/profiles/profile.h" | 16 #include "chrome/browser/profiles/profile.h" |
17 #include "chrome/browser/ui/extensions/application_launch.h" | 17 #include "chrome/browser/ui/extensions/application_launch.h" |
18 #include "chrome/common/extensions/api/easy_unlock_private.h" | 18 #include "chrome/common/extensions/api/easy_unlock_private.h" |
19 #include "chrome/common/extensions/extension_constants.h" | 19 #include "chrome/common/extensions/extension_constants.h" |
20 #include "components/proximity_auth/logging/logging.h" | |
21 #include "components/proximity_auth/switches.h" | 20 #include "components/proximity_auth/switches.h" |
22 #include "extensions/browser/event_router.h" | 21 #include "extensions/browser/event_router.h" |
23 #include "extensions/browser/extension_system.h" | 22 #include "extensions/browser/extension_system.h" |
24 #include "extensions/common/one_shot_event.h" | 23 #include "extensions/common/one_shot_event.h" |
25 | 24 |
26 #if defined(OS_CHROMEOS) | 25 #if defined(OS_CHROMEOS) |
27 #include "base/sys_info.h" | 26 #include "base/sys_info.h" |
28 #endif | 27 #endif |
29 | 28 |
30 namespace { | 29 namespace { |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 | 71 |
73 EasyUnlockAppManagerImpl::~EasyUnlockAppManagerImpl() { | 72 EasyUnlockAppManagerImpl::~EasyUnlockAppManagerImpl() { |
74 } | 73 } |
75 | 74 |
76 void EasyUnlockAppManagerImpl::EnsureReady( | 75 void EasyUnlockAppManagerImpl::EnsureReady( |
77 const base::Closure& ready_callback) { | 76 const base::Closure& ready_callback) { |
78 extension_system_->ready().Post(FROM_HERE, ready_callback); | 77 extension_system_->ready().Post(FROM_HERE, ready_callback); |
79 } | 78 } |
80 | 79 |
81 void EasyUnlockAppManagerImpl::LaunchSetup() { | 80 void EasyUnlockAppManagerImpl::LaunchSetup() { |
82 PA_LOG(WARNING) << "LaunchSetup()"; | |
83 ExtensionService* extension_service = extension_system_->extension_service(); | 81 ExtensionService* extension_service = extension_system_->extension_service(); |
84 if (!extension_service) | 82 if (!extension_service) |
85 return; | 83 return; |
86 PA_LOG(WARNING) << "got extension service"; | |
87 | 84 |
88 const extensions::Extension* extension = | 85 const extensions::Extension* extension = |
89 extension_service->GetExtensionById(app_id_, false); | 86 extension_service->GetExtensionById(app_id_, false); |
90 if (!extension) { | 87 if (!extension) |
91 PA_LOG(WARNING) << "No extension"; | |
92 return; | 88 return; |
93 } | |
94 | 89 |
95 PA_LOG(WARNING) << "launching app..."; | |
96 OpenApplication(AppLaunchParams(extension_service->profile(), extension, | 90 OpenApplication(AppLaunchParams(extension_service->profile(), extension, |
97 extensions::LAUNCH_CONTAINER_WINDOW, | 91 extensions::LAUNCH_CONTAINER_WINDOW, |
98 WindowOpenDisposition::NEW_WINDOW, | 92 WindowOpenDisposition::NEW_WINDOW, |
99 extensions::SOURCE_CHROME_INTERNAL)); | 93 extensions::SOURCE_CHROME_INTERNAL)); |
100 } | 94 } |
101 | 95 |
102 void EasyUnlockAppManagerImpl::LoadApp() { | 96 void EasyUnlockAppManagerImpl::LoadApp() { |
103 ExtensionService* extension_service = extension_system_->extension_service(); | 97 ExtensionService* extension_service = extension_system_->extension_service(); |
104 if (!extension_service) | 98 if (!extension_service) |
105 return; | 99 return; |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 } | 194 } |
201 | 195 |
202 // static | 196 // static |
203 std::unique_ptr<EasyUnlockAppManager> EasyUnlockAppManager::Create( | 197 std::unique_ptr<EasyUnlockAppManager> EasyUnlockAppManager::Create( |
204 extensions::ExtensionSystem* extension_system, | 198 extensions::ExtensionSystem* extension_system, |
205 int manifest_id, | 199 int manifest_id, |
206 const base::FilePath& app_path) { | 200 const base::FilePath& app_path) { |
207 return std::unique_ptr<EasyUnlockAppManager>( | 201 return std::unique_ptr<EasyUnlockAppManager>( |
208 new EasyUnlockAppManagerImpl(extension_system, manifest_id, app_path)); | 202 new EasyUnlockAppManagerImpl(extension_system, manifest_id, app_path)); |
209 } | 203 } |
OLD | NEW |