| 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/url_constants.h" | 13 #include "chrome/common/url_constants.h" |
| 14 #include "extensions/common/error_utils.h" | 14 #include "extensions/common/error_utils.h" |
| 15 #include "extensions/common/manifest_constants.h" | 15 #include "extensions/common/manifest_constants.h" |
| 16 #include "extensions/common/switches.h" |
| 16 | 17 |
| 17 namespace extensions { | 18 namespace extensions { |
| 18 | 19 |
| 19 namespace keys = manifest_keys; | 20 namespace keys = manifest_keys; |
| 20 namespace values = manifest_values; | 21 namespace values = manifest_values; |
| 21 namespace errors = manifest_errors; | 22 namespace errors = manifest_errors; |
| 22 | 23 |
| 23 namespace { | 24 namespace { |
| 24 | 25 |
| 25 bool ReadLaunchDimension(const extensions::Manifest* manifest, | 26 bool ReadLaunchDimension(const extensions::Manifest* manifest, |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 GURL gallery_url(gallery_url_str); | 202 GURL gallery_url(gallery_url_str); |
| 202 OverrideLaunchURL(extension, gallery_url); | 203 OverrideLaunchURL(extension, gallery_url); |
| 203 } | 204 } |
| 204 } else if (extension->id() == extension_misc::kCloudPrintAppId) { | 205 } else if (extension->id() == extension_misc::kCloudPrintAppId) { |
| 205 // In order for the --cloud-print-service switch to work, we must update | 206 // In order for the --cloud-print-service switch to work, we must update |
| 206 // the launch URL and web extent. | 207 // the launch URL and web extent. |
| 207 // TODO(sanjeevr): Ideally we want to use CloudPrintURL here but that is | 208 // TODO(sanjeevr): Ideally we want to use CloudPrintURL here but that is |
| 208 // currently under chrome/browser. | 209 // currently under chrome/browser. |
| 209 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 210 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 210 GURL cloud_print_service_url = GURL(command_line.GetSwitchValueASCII( | 211 GURL cloud_print_service_url = GURL(command_line.GetSwitchValueASCII( |
| 211 switches::kCloudPrintServiceURL)); | 212 ::switches::kCloudPrintServiceURL)); |
| 212 if (!cloud_print_service_url.is_empty()) { | 213 if (!cloud_print_service_url.is_empty()) { |
| 213 std::string path( | 214 std::string path( |
| 214 cloud_print_service_url.path() + "/enable_chrome_connector"); | 215 cloud_print_service_url.path() + "/enable_chrome_connector"); |
| 215 GURL::Replacements replacements; | 216 GURL::Replacements replacements; |
| 216 replacements.SetPathStr(path); | 217 replacements.SetPathStr(path); |
| 217 GURL cloud_print_enable_connector_url = | 218 GURL cloud_print_enable_connector_url = |
| 218 cloud_print_service_url.ReplaceComponents(replacements); | 219 cloud_print_service_url.ReplaceComponents(replacements); |
| 219 OverrideLaunchURL(extension, cloud_print_enable_connector_url); | 220 OverrideLaunchURL(extension, cloud_print_enable_connector_url); |
| 220 } | 221 } |
| 221 } | 222 } |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 keys::kLaunchLocalPath, | 317 keys::kLaunchLocalPath, |
| 317 keys::kLaunchWebURL, | 318 keys::kLaunchWebURL, |
| 318 keys::kLaunchContainer, | 319 keys::kLaunchContainer, |
| 319 keys::kLaunchHeight, | 320 keys::kLaunchHeight, |
| 320 keys::kLaunchWidth | 321 keys::kLaunchWidth |
| 321 }; | 322 }; |
| 322 return std::vector<std::string>(keys, keys + arraysize(keys)); | 323 return std::vector<std::string>(keys, keys + arraysize(keys)); |
| 323 } | 324 } |
| 324 | 325 |
| 325 } // namespace extensions | 326 } // namespace extensions |
| OLD | NEW |