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" |
(...skipping 10 matching lines...) Expand all Loading... |
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" |
| 31 #include "extensions/common/constants.h" |
31 #include "ui/base/cocoa/focus_window_set.h" | 32 #include "ui/base/cocoa/focus_window_set.h" |
32 | 33 |
33 using extensions::AppWindow; | 34 using extensions::AppWindow; |
34 using extensions::AppWindowRegistry; | 35 using extensions::AppWindowRegistry; |
35 using extensions::ExtensionRegistry; | 36 using extensions::ExtensionRegistry; |
36 | 37 |
37 namespace { | 38 namespace { |
38 | 39 |
39 typedef AppWindowRegistry::AppWindowList AppWindowList; | 40 typedef AppWindowRegistry::AppWindowList AppWindowList; |
40 | 41 |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 (new EnableViaPrompt(profile, extension_id, callback))->Run(); | 179 (new EnableViaPrompt(profile, extension_id, callback))->Run(); |
179 } | 180 } |
180 | 181 |
181 void ExtensionAppShimHandler::Delegate::LaunchApp( | 182 void ExtensionAppShimHandler::Delegate::LaunchApp( |
182 Profile* profile, | 183 Profile* profile, |
183 const extensions::Extension* extension, | 184 const extensions::Extension* extension, |
184 const std::vector<base::FilePath>& files) { | 185 const std::vector<base::FilePath>& files) { |
185 CoreAppLauncherHandler::RecordAppLaunchType( | 186 CoreAppLauncherHandler::RecordAppLaunchType( |
186 extension_misc::APP_LAUNCH_CMD_LINE_APP, extension->GetType()); | 187 extension_misc::APP_LAUNCH_CMD_LINE_APP, extension->GetType()); |
187 if (files.empty()) { | 188 if (files.empty()) { |
188 apps::LaunchPlatformApp(profile, extension); | 189 apps::LaunchPlatformApp( |
| 190 profile, extension, extensions::SOURCE_COMMAND_LINE); |
189 } else { | 191 } else { |
190 for (std::vector<base::FilePath>::const_iterator it = files.begin(); | 192 for (std::vector<base::FilePath>::const_iterator it = files.begin(); |
191 it != files.end(); ++it) { | 193 it != files.end(); ++it) { |
192 apps::LaunchPlatformAppWithPath(profile, extension, *it); | 194 apps::LaunchPlatformAppWithPath(profile, extension, *it); |
193 } | 195 } |
194 } | 196 } |
195 } | 197 } |
196 | 198 |
197 void ExtensionAppShimHandler::Delegate::LaunchShim( | 199 void ExtensionAppShimHandler::Delegate::LaunchShim( |
198 Profile* profile, | 200 Profile* profile, |
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
547 if (hosts_.empty()) | 549 if (hosts_.empty()) |
548 delegate_->MaybeTerminate(); | 550 delegate_->MaybeTerminate(); |
549 } | 551 } |
550 | 552 |
551 void ExtensionAppShimHandler::OnAppStop(Profile* profile, | 553 void ExtensionAppShimHandler::OnAppStop(Profile* profile, |
552 const std::string& app_id) {} | 554 const std::string& app_id) {} |
553 | 555 |
554 void ExtensionAppShimHandler::OnChromeTerminating() {} | 556 void ExtensionAppShimHandler::OnChromeTerminating() {} |
555 | 557 |
556 } // namespace apps | 558 } // namespace apps |
OLD | NEW |