| 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 "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
| 9 #include "chrome/common/chrome_switches.h" | 9 #include "chrome/common/chrome_switches.h" |
| 10 #include "chrome/common/chrome_version_info.h" | 10 #include "chrome/common/chrome_version_info.h" |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 ExtensionAPI* api) const { | 260 ExtensionAPI* api) const { |
| 261 #if defined(ENABLE_EXTENSIONS) | 261 #if defined(ENABLE_EXTENSIONS) |
| 262 api->RegisterSchemaResource("accessibilityPrivate", | 262 api->RegisterSchemaResource("accessibilityPrivate", |
| 263 IDR_EXTENSION_API_JSON_ACCESSIBILITYPRIVATE); | 263 IDR_EXTENSION_API_JSON_ACCESSIBILITYPRIVATE); |
| 264 api->RegisterSchemaResource("app", IDR_EXTENSION_API_JSON_APP); | 264 api->RegisterSchemaResource("app", IDR_EXTENSION_API_JSON_APP); |
| 265 api->RegisterSchemaResource("browserAction", | 265 api->RegisterSchemaResource("browserAction", |
| 266 IDR_EXTENSION_API_JSON_BROWSERACTION); | 266 IDR_EXTENSION_API_JSON_BROWSERACTION); |
| 267 api->RegisterSchemaResource("commands", IDR_EXTENSION_API_JSON_COMMANDS); | 267 api->RegisterSchemaResource("commands", IDR_EXTENSION_API_JSON_COMMANDS); |
| 268 api->RegisterSchemaResource("declarativeContent", | 268 api->RegisterSchemaResource("declarativeContent", |
| 269 IDR_EXTENSION_API_JSON_DECLARATIVE_CONTENT); | 269 IDR_EXTENSION_API_JSON_DECLARATIVE_CONTENT); |
| 270 api->RegisterSchemaResource("declarativeWebRequest", |
| 271 IDR_EXTENSION_API_JSON_DECLARATIVE_WEBREQUEST); |
| 270 api->RegisterSchemaResource("fileBrowserHandler", | 272 api->RegisterSchemaResource("fileBrowserHandler", |
| 271 IDR_EXTENSION_API_JSON_FILEBROWSERHANDLER); | 273 IDR_EXTENSION_API_JSON_FILEBROWSERHANDLER); |
| 272 api->RegisterSchemaResource("inputMethodPrivate", | 274 api->RegisterSchemaResource("inputMethodPrivate", |
| 273 IDR_EXTENSION_API_JSON_INPUTMETHODPRIVATE); | 275 IDR_EXTENSION_API_JSON_INPUTMETHODPRIVATE); |
| 274 api->RegisterSchemaResource("pageAction", IDR_EXTENSION_API_JSON_PAGEACTION); | 276 api->RegisterSchemaResource("pageAction", IDR_EXTENSION_API_JSON_PAGEACTION); |
| 275 api->RegisterSchemaResource("privacy", IDR_EXTENSION_API_JSON_PRIVACY); | 277 api->RegisterSchemaResource("privacy", IDR_EXTENSION_API_JSON_PRIVACY); |
| 276 api->RegisterSchemaResource("processes", IDR_EXTENSION_API_JSON_PROCESSES); | 278 api->RegisterSchemaResource("processes", IDR_EXTENSION_API_JSON_PROCESSES); |
| 277 api->RegisterSchemaResource("proxy", IDR_EXTENSION_API_JSON_PROXY); | 279 api->RegisterSchemaResource("proxy", IDR_EXTENSION_API_JSON_PROXY); |
| 278 api->RegisterSchemaResource("scriptBadge", | 280 api->RegisterSchemaResource("scriptBadge", |
| 279 IDR_EXTENSION_API_JSON_SCRIPTBADGE); | 281 IDR_EXTENSION_API_JSON_SCRIPTBADGE); |
| 280 api->RegisterSchemaResource("ttsEngine", IDR_EXTENSION_API_JSON_TTSENGINE); | 282 api->RegisterSchemaResource("ttsEngine", IDR_EXTENSION_API_JSON_TTSENGINE); |
| 281 api->RegisterSchemaResource("tts", IDR_EXTENSION_API_JSON_TTS); | 283 api->RegisterSchemaResource("tts", IDR_EXTENSION_API_JSON_TTS); |
| 282 api->RegisterSchemaResource("types", IDR_EXTENSION_API_JSON_TYPES); | 284 api->RegisterSchemaResource("types", IDR_EXTENSION_API_JSON_TYPES); |
| 283 api->RegisterSchemaResource("types.private", | 285 api->RegisterSchemaResource("types.private", |
| 284 IDR_EXTENSION_API_JSON_TYPES_PRIVATE); | 286 IDR_EXTENSION_API_JSON_TYPES_PRIVATE); |
| 285 api->RegisterSchemaResource("webstore", IDR_EXTENSION_API_JSON_WEBSTORE); | 287 api->RegisterSchemaResource("webstore", IDR_EXTENSION_API_JSON_WEBSTORE); |
| 288 api->RegisterSchemaResource("webViewRequest", |
| 289 IDR_EXTENSION_API_JSON_WEB_VIEW_REQUEST); |
| 286 #endif // defined(ENABLE_EXTENSIONS) | 290 #endif // defined(ENABLE_EXTENSIONS) |
| 287 } | 291 } |
| 288 | 292 |
| 289 bool ChromeExtensionsClient::ShouldSuppressFatalErrors() const { | 293 bool ChromeExtensionsClient::ShouldSuppressFatalErrors() const { |
| 290 // Suppress fatal errors only on beta and stable channels. | 294 // Suppress fatal errors only on beta and stable channels. |
| 291 return GetCurrentChannel() > chrome::VersionInfo::CHANNEL_DEV; | 295 return GetCurrentChannel() > chrome::VersionInfo::CHANNEL_DEV; |
| 292 } | 296 } |
| 293 | 297 |
| 294 std::string ChromeExtensionsClient::GetWebstoreBaseURL() const { | 298 std::string ChromeExtensionsClient::GetWebstoreBaseURL() const { |
| 295 std::string gallery_prefix = extension_urls::kChromeWebstoreBaseURL; | 299 std::string gallery_prefix = extension_urls::kChromeWebstoreBaseURL; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 319 return StartsWithASCII(url.spec(), kExtensionBlocklistUrlPrefix, true) || | 323 return StartsWithASCII(url.spec(), kExtensionBlocklistUrlPrefix, true) || |
| 320 StartsWithASCII(url.spec(), kExtensionBlocklistHttpsUrlPrefix, true); | 324 StartsWithASCII(url.spec(), kExtensionBlocklistHttpsUrlPrefix, true); |
| 321 } | 325 } |
| 322 | 326 |
| 323 // static | 327 // static |
| 324 ChromeExtensionsClient* ChromeExtensionsClient::GetInstance() { | 328 ChromeExtensionsClient* ChromeExtensionsClient::GetInstance() { |
| 325 return g_client.Pointer(); | 329 return g_client.Pointer(); |
| 326 } | 330 } |
| 327 | 331 |
| 328 } // namespace extensions | 332 } // namespace extensions |
| OLD | NEW |