OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/apps/app_shim/extension_app_shim_handler_mac.h" | 5 #include "chrome/browser/apps/app_shim/extension_app_shim_handler_mac.h" |
6 | 6 |
7 #include "apps/app_lifetime_monitor_factory.h" | 7 #include "apps/app_lifetime_monitor_factory.h" |
8 #include "apps/launcher.h" | 8 #include "apps/launcher.h" |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "chrome/browser/apps/app_shim/app_shim_host_manager_mac.h" | 11 #include "chrome/browser/apps/app_shim/app_shim_host_manager_mac.h" |
12 #include "chrome/browser/browser_process.h" | 12 #include "chrome/browser/browser_process.h" |
13 #include "chrome/browser/chrome_notification_types.h" | 13 #include "chrome/browser/chrome_notification_types.h" |
14 #include "chrome/browser/profiles/profile.h" | 14 #include "chrome/browser/profiles/profile.h" |
15 #include "chrome/browser/profiles/profile_manager.h" | 15 #include "chrome/browser/profiles/profile_manager.h" |
16 #include "chrome/browser/ui/extensions/extension_enable_flow.h" | 16 #include "chrome/browser/ui/extensions/extension_enable_flow.h" |
17 #include "chrome/browser/ui/extensions/extension_enable_flow_delegate.h" | 17 #include "chrome/browser/ui/extensions/extension_enable_flow_delegate.h" |
18 #include "chrome/browser/ui/webui/ntp/core_app_launcher_handler.h" | |
19 #include "chrome/browser/web_applications/web_app_mac.h" | 18 #include "chrome/browser/web_applications/web_app_mac.h" |
20 #include "chrome/common/extensions/extension_constants.h" | 19 #include "chrome/common/extensions/extension_constants.h" |
| 20 #include "chrome/common/extensions/extension_metrics.h" |
21 #include "chrome/common/mac/app_shim_messages.h" | 21 #include "chrome/common/mac/app_shim_messages.h" |
22 #include "components/crx_file/id_util.h" | 22 #include "components/crx_file/id_util.h" |
23 #include "content/public/browser/notification_details.h" | 23 #include "content/public/browser/notification_details.h" |
24 #include "content/public/browser/notification_service.h" | 24 #include "content/public/browser/notification_service.h" |
25 #include "content/public/browser/notification_source.h" | 25 #include "content/public/browser/notification_source.h" |
26 #include "extensions/browser/app_window/app_window.h" | 26 #include "extensions/browser/app_window/app_window.h" |
27 #include "extensions/browser/app_window/app_window_registry.h" | 27 #include "extensions/browser/app_window/app_window_registry.h" |
28 #include "extensions/browser/app_window/native_app_window.h" | 28 #include "extensions/browser/app_window/native_app_window.h" |
29 #include "extensions/browser/extension_host.h" | 29 #include "extensions/browser/extension_host.h" |
30 #include "extensions/browser/extension_registry.h" | 30 #include "extensions/browser/extension_registry.h" |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 Profile* profile, | 176 Profile* profile, |
177 const std::string& extension_id, | 177 const std::string& extension_id, |
178 const base::Callback<void()>& callback) { | 178 const base::Callback<void()>& callback) { |
179 (new EnableViaPrompt(profile, extension_id, callback))->Run(); | 179 (new EnableViaPrompt(profile, extension_id, callback))->Run(); |
180 } | 180 } |
181 | 181 |
182 void ExtensionAppShimHandler::Delegate::LaunchApp( | 182 void ExtensionAppShimHandler::Delegate::LaunchApp( |
183 Profile* profile, | 183 Profile* profile, |
184 const extensions::Extension* extension, | 184 const extensions::Extension* extension, |
185 const std::vector<base::FilePath>& files) { | 185 const std::vector<base::FilePath>& files) { |
186 CoreAppLauncherHandler::RecordAppLaunchType( | 186 extensions::RecordAppLaunchType( |
187 extension_misc::APP_LAUNCH_CMD_LINE_APP, extension->GetType()); | 187 extension_misc::APP_LAUNCH_CMD_LINE_APP, extension->GetType()); |
188 if (files.empty()) { | 188 if (files.empty()) { |
189 apps::LaunchPlatformApp( | 189 apps::LaunchPlatformApp( |
190 profile, extension, extensions::SOURCE_COMMAND_LINE); | 190 profile, extension, extensions::SOURCE_COMMAND_LINE); |
191 } else { | 191 } else { |
192 for (std::vector<base::FilePath>::const_iterator it = files.begin(); | 192 for (std::vector<base::FilePath>::const_iterator it = files.begin(); |
193 it != files.end(); ++it) { | 193 it != files.end(); ++it) { |
194 apps::LaunchPlatformAppWithPath(profile, extension, *it); | 194 apps::LaunchPlatformAppWithPath(profile, extension, *it); |
195 } | 195 } |
196 } | 196 } |
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
549 if (hosts_.empty()) | 549 if (hosts_.empty()) |
550 delegate_->MaybeTerminate(); | 550 delegate_->MaybeTerminate(); |
551 } | 551 } |
552 | 552 |
553 void ExtensionAppShimHandler::OnAppStop(Profile* profile, | 553 void ExtensionAppShimHandler::OnAppStop(Profile* profile, |
554 const std::string& app_id) {} | 554 const std::string& app_id) {} |
555 | 555 |
556 void ExtensionAppShimHandler::OnChromeTerminating() {} | 556 void ExtensionAppShimHandler::OnChromeTerminating() {} |
557 | 557 |
558 } // namespace apps | 558 } // namespace apps |
OLD | NEW |