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/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" |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 170 return false; | 170 return false; |
| 171 } | 171 } |
| 172 | 172 |
| 173 // For the Chrome component app, override launch url to new tab. | 173 // For the Chrome component app, override launch url to new tab. |
| 174 if (extension->id() == extension_misc::kChromeAppId) { | 174 if (extension->id() == extension_misc::kChromeAppId) { |
| 175 launch_web_url_ = GURL(chrome::kChromeUINewTabURL); | 175 launch_web_url_ = GURL(chrome::kChromeUINewTabURL); |
| 176 return true; | 176 return true; |
| 177 } | 177 } |
| 178 | 178 |
| 179 // If there is no extent, we default the extent based on the launch URL. | 179 // If there is no extent, we default the extent based on the launch URL. |
| 180 if (extension->web_extent().is_empty() && !launch_web_url_.is_empty()) { | 180 // Bookmark apps are permissionless and shouldn't be restricted by overlapping |
| 181 // extents. | |
|
benwells
2014/01/21 22:42:13
Isn't this from another change, and no longer need
calamity
2014/01/24 06:06:13
My bad, branch management. Removed.
| |
| 182 if (extension->web_extent().is_empty() && !launch_web_url_.is_empty() && | |
| 183 !extension->from_bookmark()) { | |
| 181 URLPattern pattern(Extension::kValidWebExtentSchemes); | 184 URLPattern pattern(Extension::kValidWebExtentSchemes); |
| 182 if (!pattern.SetScheme("*")) { | 185 if (!pattern.SetScheme("*")) { |
| 183 *error = ErrorUtils::FormatErrorMessageUTF16( | 186 *error = ErrorUtils::FormatErrorMessageUTF16( |
| 184 errors::kInvalidLaunchValue, | 187 errors::kInvalidLaunchValue, |
| 185 keys::kLaunchWebURL); | 188 keys::kLaunchWebURL); |
| 186 return false; | 189 return false; |
| 187 } | 190 } |
| 188 pattern.SetHost(launch_web_url_.host()); | 191 pattern.SetHost(launch_web_url_.host()); |
| 189 pattern.SetPath("/*"); | 192 pattern.SetPath("/*"); |
| 190 extension->AddWebExtentPattern(pattern); | 193 extension->AddWebExtentPattern(pattern); |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 317 keys::kLaunchLocalPath, | 320 keys::kLaunchLocalPath, |
| 318 keys::kLaunchWebURL, | 321 keys::kLaunchWebURL, |
| 319 keys::kLaunchContainer, | 322 keys::kLaunchContainer, |
| 320 keys::kLaunchHeight, | 323 keys::kLaunchHeight, |
| 321 keys::kLaunchWidth | 324 keys::kLaunchWidth |
| 322 }; | 325 }; |
| 323 return std::vector<std::string>(keys, keys + arraysize(keys)); | 326 return std::vector<std::string>(keys, keys + arraysize(keys)); |
| 324 } | 327 } |
| 325 | 328 |
| 326 } // namespace extensions | 329 } // namespace extensions |
| OLD | NEW |