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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
114 extensions::ExtensionRegistry::Get(lock_screen_profile_); | 114 extensions::ExtensionRegistry::Get(lock_screen_profile_); |
115 const extensions::Extension* app = extension_registry->GetExtensionById( | 115 const extensions::Extension* app = extension_registry->GetExtensionById( |
116 lock_screen_app_id_, extensions::ExtensionRegistry::ENABLED); | 116 lock_screen_app_id_, extensions::ExtensionRegistry::ENABLED); |
117 if (!app) | 117 if (!app) |
118 return false; | 118 return false; |
119 | 119 |
120 auto action_data = | 120 auto action_data = |
121 base::MakeUnique<extensions::api::app_runtime::ActionData>(); | 121 base::MakeUnique<extensions::api::app_runtime::ActionData>(); |
122 action_data->action_type = | 122 action_data->action_type = |
123 extensions::api::app_runtime::ActionType::ACTION_TYPE_NEW_NOTE; | 123 extensions::api::app_runtime::ActionType::ACTION_TYPE_NEW_NOTE; |
124 action_data->is_lock_screen_action = base::MakeUnique<bool>(true); | |
benwells
2017/06/13 10:30:46
Can this only happen for lock screen note taking?
tbarzic
2017/06/13 19:17:59
Notes can be taken at other times (i.e. from unloc
| |
124 apps::LaunchPlatformAppWithAction(lock_screen_profile_, app, | 125 apps::LaunchPlatformAppWithAction(lock_screen_profile_, app, |
125 std::move(action_data), base::FilePath()); | 126 std::move(action_data), base::FilePath()); |
126 return true; | 127 return true; |
127 } | 128 } |
128 | 129 |
129 void AppManagerImpl::OnExtensionLoaded(content::BrowserContext* browser_context, | 130 void AppManagerImpl::OnExtensionLoaded(content::BrowserContext* browser_context, |
130 const extensions::Extension* extension) { | 131 const extensions::Extension* extension) { |
131 if (extension->id() == | 132 if (extension->id() == |
132 primary_profile_->GetPrefs()->GetString(prefs::kNoteTakingAppId)) { | 133 primary_profile_->GetPrefs()->GetString(prefs::kNoteTakingAppId)) { |
133 OnNoteTakingExtensionChanged(); | 134 OnNoteTakingExtensionChanged(); |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
221 | 222 |
222 base::string16 error; | 223 base::string16 error; |
223 extensions::ExtensionSystem::Get(lock_screen_profile_) | 224 extensions::ExtensionSystem::Get(lock_screen_profile_) |
224 ->extension_service() | 225 ->extension_service() |
225 ->UninstallExtension(app_id, | 226 ->UninstallExtension(app_id, |
226 extensions::UNINSTALL_REASON_INTERNAL_MANAGEMENT, | 227 extensions::UNINSTALL_REASON_INTERNAL_MANAGEMENT, |
227 base::Bind(&base::DoNothing), &error); | 228 base::Bind(&base::DoNothing), &error); |
228 } | 229 } |
229 | 230 |
230 } // namespace lock_screen_apps | 231 } // namespace lock_screen_apps |
OLD | NEW |