| 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 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 } | 209 } |
| 210 | 210 |
| 211 void ExtensionAppShimHandler::Delegate::LaunchApp( | 211 void ExtensionAppShimHandler::Delegate::LaunchApp( |
| 212 Profile* profile, | 212 Profile* profile, |
| 213 const Extension* extension, | 213 const Extension* extension, |
| 214 const std::vector<base::FilePath>& files) { | 214 const std::vector<base::FilePath>& files) { |
| 215 extensions::RecordAppLaunchType( | 215 extensions::RecordAppLaunchType( |
| 216 extension_misc::APP_LAUNCH_CMD_LINE_APP, extension->GetType()); | 216 extension_misc::APP_LAUNCH_CMD_LINE_APP, extension->GetType()); |
| 217 if (extension->is_hosted_app()) { | 217 if (extension->is_hosted_app()) { |
| 218 OpenApplication(CreateAppLaunchParamsUserContainer( | 218 OpenApplication(CreateAppLaunchParamsUserContainer( |
| 219 profile, extension, NEW_FOREGROUND_TAB, | 219 profile, extension, WindowOpenDisposition::NEW_FOREGROUND_TAB, |
| 220 extensions::SOURCE_COMMAND_LINE)); | 220 extensions::SOURCE_COMMAND_LINE)); |
| 221 return; | 221 return; |
| 222 } | 222 } |
| 223 if (files.empty()) { | 223 if (files.empty()) { |
| 224 apps::LaunchPlatformApp( | 224 apps::LaunchPlatformApp( |
| 225 profile, extension, extensions::SOURCE_COMMAND_LINE); | 225 profile, extension, extensions::SOURCE_COMMAND_LINE); |
| 226 } else { | 226 } else { |
| 227 for (std::vector<base::FilePath>::const_iterator it = files.begin(); | 227 for (std::vector<base::FilePath>::const_iterator it = files.begin(); |
| 228 it != files.end(); ++it) { | 228 it != files.end(); ++it) { |
| 229 apps::LaunchPlatformAppWithPath(profile, extension, *it); | 229 apps::LaunchPlatformAppWithPath(profile, extension, *it); |
| (...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 753 AppBrowserMap::iterator it = app_browser_windows_.find(extension->id()); | 753 AppBrowserMap::iterator it = app_browser_windows_.find(extension->id()); |
| 754 if (it != app_browser_windows_.end()) { | 754 if (it != app_browser_windows_.end()) { |
| 755 BrowserSet& browsers = it->second; | 755 BrowserSet& browsers = it->second; |
| 756 browsers.erase(browser); | 756 browsers.erase(browser); |
| 757 if (browsers.empty()) | 757 if (browsers.empty()) |
| 758 OnAppDeactivated(browser->profile(), extension->id()); | 758 OnAppDeactivated(browser->profile(), extension->id()); |
| 759 } | 759 } |
| 760 } | 760 } |
| 761 | 761 |
| 762 } // namespace apps | 762 } // namespace apps |
| OLD | NEW |