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/common/extensions/manifest_handlers/app_launch_info.h" | 5 #include "chrome/common/extensions/manifest_handlers/app_launch_info.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
11 #include "base/values.h" | 11 #include "base/values.h" |
12 #include "chrome/common/chrome_switches.h" | 12 #include "chrome/common/chrome_switches.h" |
13 #include "chrome/common/extensions/extension_constants.h" | 13 #include "chrome/common/extensions/extension_constants.h" |
14 #include "chrome/common/url_constants.h" | 14 #include "chrome/common/url_constants.h" |
15 #include "components/cloud_devices/common/cloud_devices_urls.h" | 15 #include "components/cloud_devices/common/cloud_devices_urls.h" |
| 16 #include "extensions/common/constants.h" |
16 #include "extensions/common/error_utils.h" | 17 #include "extensions/common/error_utils.h" |
17 #include "extensions/common/manifest_constants.h" | 18 #include "extensions/common/manifest_constants.h" |
18 | 19 |
19 namespace extensions { | 20 namespace extensions { |
20 | 21 |
21 namespace keys = manifest_keys; | 22 namespace keys = manifest_keys; |
22 namespace values = manifest_values; | 23 namespace values = manifest_values; |
23 namespace errors = manifest_errors; | 24 namespace errors = manifest_errors; |
24 | 25 |
25 namespace { | 26 namespace { |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 return false; | 188 return false; |
188 } | 189 } |
189 pattern.SetHost(launch_web_url_.host()); | 190 pattern.SetHost(launch_web_url_.host()); |
190 pattern.SetPath("/*"); | 191 pattern.SetPath("/*"); |
191 extension->AddWebExtentPattern(pattern); | 192 extension->AddWebExtentPattern(pattern); |
192 } | 193 } |
193 | 194 |
194 // In order for the --apps-gallery-url switch to work with the gallery | 195 // In order for the --apps-gallery-url switch to work with the gallery |
195 // process isolation, we must insert any provided value into the component | 196 // process isolation, we must insert any provided value into the component |
196 // app's launch url and web extent. | 197 // app's launch url and web extent. |
197 if (extension->id() == extension_misc::kWebStoreAppId) { | 198 if (extension->id() == extensions::kWebStoreAppId) { |
198 std::string gallery_url_str = CommandLine::ForCurrentProcess()-> | 199 std::string gallery_url_str = CommandLine::ForCurrentProcess()-> |
199 GetSwitchValueASCII(switches::kAppsGalleryURL); | 200 GetSwitchValueASCII(switches::kAppsGalleryURL); |
200 | 201 |
201 // Empty string means option was not used. | 202 // Empty string means option was not used. |
202 if (!gallery_url_str.empty()) { | 203 if (!gallery_url_str.empty()) { |
203 GURL gallery_url(gallery_url_str); | 204 GURL gallery_url(gallery_url_str); |
204 OverrideLaunchURL(extension, gallery_url); | 205 OverrideLaunchURL(extension, gallery_url); |
205 } | 206 } |
206 } else if (extension->id() == extension_misc::kCloudPrintAppId) { | 207 } else if (extension->id() == extension_misc::kCloudPrintAppId) { |
207 // In order for the --cloud-print-service switch to work, we must update | 208 // In order for the --cloud-print-service switch to work, we must update |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 keys::kLaunchLocalPath, | 310 keys::kLaunchLocalPath, |
310 keys::kLaunchWebURL, | 311 keys::kLaunchWebURL, |
311 keys::kLaunchContainer, | 312 keys::kLaunchContainer, |
312 keys::kLaunchHeight, | 313 keys::kLaunchHeight, |
313 keys::kLaunchWidth | 314 keys::kLaunchWidth |
314 }; | 315 }; |
315 return std::vector<std::string>(keys, keys + arraysize(keys)); | 316 return std::vector<std::string>(keys, keys + arraysize(keys)); |
316 } | 317 } |
317 | 318 |
318 } // namespace extensions | 319 } // namespace extensions |
OLD | NEW |