OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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/chromeos/lock_screen_apps/app_manager_impl.h" | 5 #include "chrome/browser/chromeos/lock_screen_apps/app_manager_impl.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 extensions::ExtensionRegistry::Get(lock_screen_profile_); | 115 extensions::ExtensionRegistry::Get(lock_screen_profile_); |
116 const extensions::Extension* app = extension_registry->GetExtensionById( | 116 const extensions::Extension* app = extension_registry->GetExtensionById( |
117 lock_screen_app_id_, extensions::ExtensionRegistry::ENABLED); | 117 lock_screen_app_id_, extensions::ExtensionRegistry::ENABLED); |
118 if (!app) | 118 if (!app) |
119 return false; | 119 return false; |
120 | 120 |
121 auto action_data = | 121 auto action_data = |
122 base::MakeUnique<extensions::api::app_runtime::ActionData>(); | 122 base::MakeUnique<extensions::api::app_runtime::ActionData>(); |
123 action_data->action_type = | 123 action_data->action_type = |
124 extensions::api::app_runtime::ActionType::ACTION_TYPE_NEW_NOTE; | 124 extensions::api::app_runtime::ActionType::ACTION_TYPE_NEW_NOTE; |
| 125 action_data->is_lock_screen_action = base::MakeUnique<bool>(true); |
125 apps::LaunchPlatformAppWithAction(lock_screen_profile_, app, | 126 apps::LaunchPlatformAppWithAction(lock_screen_profile_, app, |
126 std::move(action_data), base::FilePath()); | 127 std::move(action_data), base::FilePath()); |
127 return true; | 128 return true; |
128 } | 129 } |
129 | 130 |
130 void AppManagerImpl::OnExtensionLoaded(content::BrowserContext* browser_context, | 131 void AppManagerImpl::OnExtensionLoaded(content::BrowserContext* browser_context, |
131 const extensions::Extension* extension) { | 132 const extensions::Extension* extension) { |
132 if (extension->id() == | 133 if (extension->id() == |
133 primary_profile_->GetPrefs()->GetString(prefs::kNoteTakingAppId)) { | 134 primary_profile_->GetPrefs()->GetString(prefs::kNoteTakingAppId)) { |
134 OnNoteTakingExtensionChanged(); | 135 OnNoteTakingExtensionChanged(); |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 | 227 |
227 base::string16 error; | 228 base::string16 error; |
228 extensions::ExtensionSystem::Get(lock_screen_profile_) | 229 extensions::ExtensionSystem::Get(lock_screen_profile_) |
229 ->extension_service() | 230 ->extension_service() |
230 ->UninstallExtension(app_id, | 231 ->UninstallExtension(app_id, |
231 extensions::UNINSTALL_REASON_INTERNAL_MANAGEMENT, | 232 extensions::UNINSTALL_REASON_INTERNAL_MANAGEMENT, |
232 base::Bind(&base::DoNothing), &error); | 233 base::Bind(&base::DoNothing), &error); |
233 } | 234 } |
234 | 235 |
235 } // namespace lock_screen_apps | 236 } // namespace lock_screen_apps |
OLD | NEW |