Chromium Code Reviews| 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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 179 (new EnableViaPrompt(profile, extension_id, callback))->Run(); | 180 (new EnableViaPrompt(profile, extension_id, callback))->Run(); |
| 180 } | 181 } |
| 181 | 182 |
| 182 void ExtensionAppShimHandler::Delegate::LaunchApp( | 183 void ExtensionAppShimHandler::Delegate::LaunchApp( |
| 183 Profile* profile, | 184 Profile* profile, |
| 184 const extensions::Extension* extension, | 185 const extensions::Extension* extension, |
| 185 const std::vector<base::FilePath>& files) { | 186 const std::vector<base::FilePath>& files) { |
| 186 CoreAppLauncherHandler::RecordAppLaunchType( | 187 CoreAppLauncherHandler::RecordAppLaunchType( |
| 187 extension_misc::APP_LAUNCH_CMD_LINE_APP, extension->GetType()); | 188 extension_misc::APP_LAUNCH_CMD_LINE_APP, extension->GetType()); |
| 188 if (files.empty()) { | 189 if (files.empty()) { |
| 189 apps::LaunchPlatformApp(profile, extension); | 190 apps::LaunchPlatformApp(profile, extension, extensions::SOURCE_UNKNOWN); |
|
benwells
2014/10/28 21:22:47
This should not be unknown, it should be SOURCE_CO
cylee1
2014/10/29 16:39:59
Done.
| |
| 190 } else { | 191 } else { |
| 191 for (std::vector<base::FilePath>::const_iterator it = files.begin(); | 192 for (std::vector<base::FilePath>::const_iterator it = files.begin(); |
| 192 it != files.end(); ++it) { | 193 it != files.end(); ++it) { |
| 193 apps::LaunchPlatformAppWithPath(profile, extension, *it); | 194 apps::LaunchPlatformAppWithPath(profile, extension, *it); |
| 194 } | 195 } |
| 195 } | 196 } |
| 196 } | 197 } |
| 197 | 198 |
| 198 void ExtensionAppShimHandler::Delegate::LaunchShim( | 199 void ExtensionAppShimHandler::Delegate::LaunchShim( |
| 199 Profile* profile, | 200 Profile* profile, |
| (...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 548 if (hosts_.empty()) | 549 if (hosts_.empty()) |
| 549 delegate_->MaybeTerminate(); | 550 delegate_->MaybeTerminate(); |
| 550 } | 551 } |
| 551 | 552 |
| 552 void ExtensionAppShimHandler::OnAppStop(Profile* profile, | 553 void ExtensionAppShimHandler::OnAppStop(Profile* profile, |
| 553 const std::string& app_id) {} | 554 const std::string& app_id) {} |
| 554 | 555 |
| 555 void ExtensionAppShimHandler::OnChromeTerminating() {} | 556 void ExtensionAppShimHandler::OnChromeTerminating() {} |
| 556 | 557 |
| 557 } // namespace apps | 558 } // namespace apps |
| OLD | NEW |