| 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" |
| 20 #include "components/proximity_auth/switches.h" | 21 #include "components/proximity_auth/switches.h" |
| 21 #include "extensions/browser/event_router.h" | 22 #include "extensions/browser/event_router.h" |
| 22 #include "extensions/browser/extension_system.h" | 23 #include "extensions/browser/extension_system.h" |
| 23 #include "extensions/common/one_shot_event.h" | 24 #include "extensions/common/one_shot_event.h" |
| 24 | 25 |
| 25 #if defined(OS_CHROMEOS) | 26 #if defined(OS_CHROMEOS) |
| 26 #include "base/sys_info.h" | 27 #include "base/sys_info.h" |
| 27 #endif | 28 #endif |
| 28 | 29 |
| 29 namespace { | 30 namespace { |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 | 72 |
| 72 EasyUnlockAppManagerImpl::~EasyUnlockAppManagerImpl() { | 73 EasyUnlockAppManagerImpl::~EasyUnlockAppManagerImpl() { |
| 73 } | 74 } |
| 74 | 75 |
| 75 void EasyUnlockAppManagerImpl::EnsureReady( | 76 void EasyUnlockAppManagerImpl::EnsureReady( |
| 76 const base::Closure& ready_callback) { | 77 const base::Closure& ready_callback) { |
| 77 extension_system_->ready().Post(FROM_HERE, ready_callback); | 78 extension_system_->ready().Post(FROM_HERE, ready_callback); |
| 78 } | 79 } |
| 79 | 80 |
| 80 void EasyUnlockAppManagerImpl::LaunchSetup() { | 81 void EasyUnlockAppManagerImpl::LaunchSetup() { |
| 82 PA_LOG(WARNING) << "LaunchSetup()"; |
| 81 ExtensionService* extension_service = extension_system_->extension_service(); | 83 ExtensionService* extension_service = extension_system_->extension_service(); |
| 82 if (!extension_service) | 84 if (!extension_service) |
| 83 return; | 85 return; |
| 86 PA_LOG(WARNING) << "got extension service"; |
| 84 | 87 |
| 85 const extensions::Extension* extension = | 88 const extensions::Extension* extension = |
| 86 extension_service->GetExtensionById(app_id_, false); | 89 extension_service->GetExtensionById(app_id_, false); |
| 87 if (!extension) | 90 if (!extension) { |
| 91 PA_LOG(WARNING) << "No extension"; |
| 88 return; | 92 return; |
| 93 } |
| 89 | 94 |
| 95 PA_LOG(WARNING) << "launching app..."; |
| 90 OpenApplication(AppLaunchParams(extension_service->profile(), extension, | 96 OpenApplication(AppLaunchParams(extension_service->profile(), extension, |
| 91 extensions::LAUNCH_CONTAINER_WINDOW, | 97 extensions::LAUNCH_CONTAINER_WINDOW, |
| 92 WindowOpenDisposition::NEW_WINDOW, | 98 WindowOpenDisposition::NEW_WINDOW, |
| 93 extensions::SOURCE_CHROME_INTERNAL)); | 99 extensions::SOURCE_CHROME_INTERNAL)); |
| 94 } | 100 } |
| 95 | 101 |
| 96 void EasyUnlockAppManagerImpl::LoadApp() { | 102 void EasyUnlockAppManagerImpl::LoadApp() { |
| 97 ExtensionService* extension_service = extension_system_->extension_service(); | 103 ExtensionService* extension_service = extension_system_->extension_service(); |
| 98 if (!extension_service) | 104 if (!extension_service) |
| 99 return; | 105 return; |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 } | 200 } |
| 195 | 201 |
| 196 // static | 202 // static |
| 197 std::unique_ptr<EasyUnlockAppManager> EasyUnlockAppManager::Create( | 203 std::unique_ptr<EasyUnlockAppManager> EasyUnlockAppManager::Create( |
| 198 extensions::ExtensionSystem* extension_system, | 204 extensions::ExtensionSystem* extension_system, |
| 199 int manifest_id, | 205 int manifest_id, |
| 200 const base::FilePath& app_path) { | 206 const base::FilePath& app_path) { |
| 201 return std::unique_ptr<EasyUnlockAppManager>( | 207 return std::unique_ptr<EasyUnlockAppManager>( |
| 202 new EasyUnlockAppManagerImpl(extension_system, manifest_id, app_path)); | 208 new EasyUnlockAppManagerImpl(extension_system, manifest_id, app_path)); |
| 203 } | 209 } |
| OLD | NEW |