| 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/chrome_extensions_client.h" | 5 #include "chrome/common/extensions/chrome_extensions_client.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 } | 225 } |
| 226 | 226 |
| 227 bool ChromeExtensionsClient::IsScriptableURL( | 227 bool ChromeExtensionsClient::IsScriptableURL( |
| 228 const GURL& url, std::string* error) const { | 228 const GURL& url, std::string* error) const { |
| 229 // The gallery is special-cased as a restricted URL for scripting to prevent | 229 // The gallery is special-cased as a restricted URL for scripting to prevent |
| 230 // access to special JS bindings we expose to the gallery (and avoid things | 230 // access to special JS bindings we expose to the gallery (and avoid things |
| 231 // like extensions removing the "report abuse" link). | 231 // like extensions removing the "report abuse" link). |
| 232 // TODO(erikkay): This seems like the wrong test. Shouldn't we we testing | 232 // TODO(erikkay): This seems like the wrong test. Shouldn't we we testing |
| 233 // against the store app extent? | 233 // against the store app extent? |
| 234 GURL store_url(extension_urls::GetWebstoreLaunchURL()); | 234 GURL store_url(extension_urls::GetWebstoreLaunchURL()); |
| 235 if (url.host() == store_url.host()) { | 235 if (url.host_piece() == store_url.host_piece()) { |
| 236 if (error) | 236 if (error) |
| 237 *error = manifest_errors::kCannotScriptGallery; | 237 *error = manifest_errors::kCannotScriptGallery; |
| 238 return false; | 238 return false; |
| 239 } | 239 } |
| 240 return true; | 240 return true; |
| 241 } | 241 } |
| 242 | 242 |
| 243 bool ChromeExtensionsClient::IsAPISchemaGenerated( | 243 bool ChromeExtensionsClient::IsAPISchemaGenerated( |
| 244 const std::string& name) const { | 244 const std::string& name) const { |
| 245 // Test from most common to least common. | 245 // Test from most common to least common. |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 334 const { | 334 const { |
| 335 return GetCurrentChannel() == version_info::Channel::UNKNOWN; | 335 return GetCurrentChannel() == version_info::Channel::UNKNOWN; |
| 336 } | 336 } |
| 337 | 337 |
| 338 // static | 338 // static |
| 339 ChromeExtensionsClient* ChromeExtensionsClient::GetInstance() { | 339 ChromeExtensionsClient* ChromeExtensionsClient::GetInstance() { |
| 340 return g_client.Pointer(); | 340 return g_client.Pointer(); |
| 341 } | 341 } |
| 342 | 342 |
| 343 } // namespace extensions | 343 } // namespace extensions |
| OLD | NEW |