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); | |
272 api->RegisterSchemaResource("fileBrowserHandler", | 270 api->RegisterSchemaResource("fileBrowserHandler", |
273 IDR_EXTENSION_API_JSON_FILEBROWSERHANDLER); | 271 IDR_EXTENSION_API_JSON_FILEBROWSERHANDLER); |
274 api->RegisterSchemaResource("inputMethodPrivate", | 272 api->RegisterSchemaResource("inputMethodPrivate", |
275 IDR_EXTENSION_API_JSON_INPUTMETHODPRIVATE); | 273 IDR_EXTENSION_API_JSON_INPUTMETHODPRIVATE); |
276 api->RegisterSchemaResource("pageAction", IDR_EXTENSION_API_JSON_PAGEACTION); | 274 api->RegisterSchemaResource("pageAction", IDR_EXTENSION_API_JSON_PAGEACTION); |
277 api->RegisterSchemaResource("privacy", IDR_EXTENSION_API_JSON_PRIVACY); | 275 api->RegisterSchemaResource("privacy", IDR_EXTENSION_API_JSON_PRIVACY); |
278 api->RegisterSchemaResource("processes", IDR_EXTENSION_API_JSON_PROCESSES); | 276 api->RegisterSchemaResource("processes", IDR_EXTENSION_API_JSON_PROCESSES); |
279 api->RegisterSchemaResource("proxy", IDR_EXTENSION_API_JSON_PROXY); | 277 api->RegisterSchemaResource("proxy", IDR_EXTENSION_API_JSON_PROXY); |
280 api->RegisterSchemaResource("scriptBadge", | 278 api->RegisterSchemaResource("scriptBadge", |
281 IDR_EXTENSION_API_JSON_SCRIPTBADGE); | 279 IDR_EXTENSION_API_JSON_SCRIPTBADGE); |
282 api->RegisterSchemaResource("ttsEngine", IDR_EXTENSION_API_JSON_TTSENGINE); | 280 api->RegisterSchemaResource("ttsEngine", IDR_EXTENSION_API_JSON_TTSENGINE); |
283 api->RegisterSchemaResource("tts", IDR_EXTENSION_API_JSON_TTS); | 281 api->RegisterSchemaResource("tts", IDR_EXTENSION_API_JSON_TTS); |
284 api->RegisterSchemaResource("types", IDR_EXTENSION_API_JSON_TYPES); | 282 api->RegisterSchemaResource("types", IDR_EXTENSION_API_JSON_TYPES); |
285 api->RegisterSchemaResource("types.private", | 283 api->RegisterSchemaResource("types.private", |
286 IDR_EXTENSION_API_JSON_TYPES_PRIVATE); | 284 IDR_EXTENSION_API_JSON_TYPES_PRIVATE); |
287 api->RegisterSchemaResource("webstore", IDR_EXTENSION_API_JSON_WEBSTORE); | 285 api->RegisterSchemaResource("webstore", IDR_EXTENSION_API_JSON_WEBSTORE); |
288 api->RegisterSchemaResource("webViewRequest", | |
289 IDR_EXTENSION_API_JSON_WEB_VIEW_REQUEST); | |
290 #endif // defined(ENABLE_EXTENSIONS) | 286 #endif // defined(ENABLE_EXTENSIONS) |
291 } | 287 } |
292 | 288 |
293 bool ChromeExtensionsClient::ShouldSuppressFatalErrors() const { | 289 bool ChromeExtensionsClient::ShouldSuppressFatalErrors() const { |
294 // Suppress fatal errors only on beta and stable channels. | 290 // Suppress fatal errors only on beta and stable channels. |
295 return GetCurrentChannel() > chrome::VersionInfo::CHANNEL_DEV; | 291 return GetCurrentChannel() > chrome::VersionInfo::CHANNEL_DEV; |
296 } | 292 } |
297 | 293 |
298 std::string ChromeExtensionsClient::GetWebstoreBaseURL() const { | 294 std::string ChromeExtensionsClient::GetWebstoreBaseURL() const { |
299 std::string gallery_prefix = extension_urls::kChromeWebstoreBaseURL; | 295 std::string gallery_prefix = extension_urls::kChromeWebstoreBaseURL; |
(...skipping 23 matching lines...) Expand all Loading... |
323 return StartsWithASCII(url.spec(), kExtensionBlocklistUrlPrefix, true) || | 319 return StartsWithASCII(url.spec(), kExtensionBlocklistUrlPrefix, true) || |
324 StartsWithASCII(url.spec(), kExtensionBlocklistHttpsUrlPrefix, true); | 320 StartsWithASCII(url.spec(), kExtensionBlocklistHttpsUrlPrefix, true); |
325 } | 321 } |
326 | 322 |
327 // static | 323 // static |
328 ChromeExtensionsClient* ChromeExtensionsClient::GetInstance() { | 324 ChromeExtensionsClient* ChromeExtensionsClient::GetInstance() { |
329 return g_client.Pointer(); | 325 return g_client.Pointer(); |
330 } | 326 } |
331 | 327 |
332 } // namespace extensions | 328 } // namespace extensions |
OLD | NEW |