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" |
11 #include "base/metrics/histogram_macros.h" | 11 #include "base/metrics/histogram_macros.h" |
12 #include "base/strings/string_util.h" | 12 #include "base/strings/string_util.h" |
13 #include "base/values.h" | 13 #include "base/values.h" |
14 #include "chrome/common/chrome_switches.h" | 14 #include "chrome/common/chrome_switches.h" |
15 #include "chrome/common/extensions/api/api_features.h" | 15 #include "chrome/common/extensions/api/api_features.h" |
16 #include "chrome/common/extensions/api/behavior_features.h" | 16 #include "chrome/common/extensions/api/behavior_features.h" |
17 #include "chrome/common/extensions/api/extension_action/action_info.h" | 17 #include "chrome/common/extensions/api/extension_action/action_info.h" |
18 #include "chrome/common/extensions/api/generated_schemas.h" | 18 #include "chrome/common/extensions/api/generated_schemas.h" |
19 #include "chrome/common/extensions/api/manifest_features.h" | 19 #include "chrome/common/extensions/api/manifest_features.h" |
20 #include "chrome/common/extensions/api/permission_features.h" | 20 #include "chrome/common/extensions/api/permission_features.h" |
21 #include "chrome/common/extensions/chrome_manifest_handlers.h" | 21 #include "chrome/common/extensions/chrome_manifest_handlers.h" |
22 #include "chrome/common/extensions/extension_constants.h" | 22 #include "chrome/common/extensions/extension_constants.h" |
23 #include "chrome/common/extensions/manifest_handlers/theme_handler.h" | 23 #include "chrome/common/extensions/manifest_handlers/theme_handler.h" |
24 #include "chrome/common/url_constants.h" | 24 #include "chrome/common/url_constants.h" |
25 #include "chrome/grit/chromium_strings.h" | 25 #include "chrome/grit/chromium_strings.h" |
26 #include "chrome/grit/common_resources.h" | 26 #include "chrome/grit/common_resources.h" |
27 #include "chrome/grit/extensions_api_resources.h" | |
28 #include "chrome/grit/generated_resources.h" | 27 #include "chrome/grit/generated_resources.h" |
29 #include "components/version_info/version_info.h" | 28 #include "components/version_info/version_info.h" |
30 #include "content/public/common/url_constants.h" | 29 #include "content/public/common/url_constants.h" |
31 #include "extensions/common/api/generated_schemas.h" | 30 #include "extensions/common/api/generated_schemas.h" |
32 #include "extensions/common/common_manifest_handlers.h" | 31 #include "extensions/common/common_manifest_handlers.h" |
33 #include "extensions/common/constants.h" | 32 #include "extensions/common/constants.h" |
34 #include "extensions/common/extension.h" | 33 #include "extensions/common/extension.h" |
35 #include "extensions/common/extension_api.h" | 34 #include "extensions/common/extension_api.h" |
36 #include "extensions/common/extension_icon_set.h" | 35 #include "extensions/common/extension_icon_set.h" |
37 #include "extensions/common/extension_urls.h" | 36 #include "extensions/common/extension_urls.h" |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
247 base::StringPiece ChromeExtensionsClient::GetAPISchema( | 246 base::StringPiece ChromeExtensionsClient::GetAPISchema( |
248 const std::string& name) const { | 247 const std::string& name) const { |
249 // Test from most common to least common. | 248 // Test from most common to least common. |
250 if (api::ChromeGeneratedSchemas::IsGenerated(name)) | 249 if (api::ChromeGeneratedSchemas::IsGenerated(name)) |
251 return api::ChromeGeneratedSchemas::Get(name); | 250 return api::ChromeGeneratedSchemas::Get(name); |
252 | 251 |
253 return api::GeneratedSchemas::Get(name); | 252 return api::GeneratedSchemas::Get(name); |
254 } | 253 } |
255 | 254 |
256 void ChromeExtensionsClient::RegisterAPISchemaResources( | 255 void ChromeExtensionsClient::RegisterAPISchemaResources( |
257 ExtensionAPI* api) const { | 256 ExtensionAPI* api) const { |
Devlin
2016/08/18 22:21:27
I think we can remove this now - I'll do that in a
| |
258 api->RegisterSchemaResource("accessibilityPrivate", | |
259 IDR_EXTENSION_API_JSON_ACCESSIBILITYPRIVATE); | |
260 api->RegisterSchemaResource("app", IDR_EXTENSION_API_JSON_APP); | |
261 api->RegisterSchemaResource("browserAction", | |
262 IDR_EXTENSION_API_JSON_BROWSERACTION); | |
263 api->RegisterSchemaResource("commands", IDR_EXTENSION_API_JSON_COMMANDS); | |
264 api->RegisterSchemaResource("declarativeContent", | |
265 IDR_EXTENSION_API_JSON_DECLARATIVE_CONTENT); | |
266 api->RegisterSchemaResource("fileBrowserHandler", | |
267 IDR_EXTENSION_API_JSON_FILEBROWSERHANDLER); | |
268 api->RegisterSchemaResource("inputMethodPrivate", | |
269 IDR_EXTENSION_API_JSON_INPUTMETHODPRIVATE); | |
270 api->RegisterSchemaResource("pageAction", IDR_EXTENSION_API_JSON_PAGEACTION); | |
271 api->RegisterSchemaResource("privacy", IDR_EXTENSION_API_JSON_PRIVACY); | |
272 api->RegisterSchemaResource("proxy", IDR_EXTENSION_API_JSON_PROXY); | |
273 api->RegisterSchemaResource("ttsEngine", IDR_EXTENSION_API_JSON_TTSENGINE); | |
274 api->RegisterSchemaResource("tts", IDR_EXTENSION_API_JSON_TTS); | |
275 api->RegisterSchemaResource("types", IDR_EXTENSION_API_JSON_TYPES); | |
276 api->RegisterSchemaResource("types.private", | |
277 IDR_EXTENSION_API_JSON_TYPES_PRIVATE); | |
278 api->RegisterSchemaResource("webstore", IDR_EXTENSION_API_JSON_WEBSTORE); | |
279 } | 257 } |
280 | 258 |
281 bool ChromeExtensionsClient::ShouldSuppressFatalErrors() const { | 259 bool ChromeExtensionsClient::ShouldSuppressFatalErrors() const { |
282 // Suppress fatal everywhere until the cause of bugs like http://crbug/471599 | 260 // Suppress fatal everywhere until the cause of bugs like http://crbug/471599 |
283 // are fixed. This would typically be: | 261 // are fixed. This would typically be: |
284 // return GetCurrentChannel() > version_info::Channel::DEV; | 262 // return GetCurrentChannel() > version_info::Channel::DEV; |
285 return true; | 263 return true; |
286 } | 264 } |
287 | 265 |
288 void ChromeExtensionsClient::RecordDidSuppressFatalError() { | 266 void ChromeExtensionsClient::RecordDidSuppressFatalError() { |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
356 const { | 334 const { |
357 return GetCurrentChannel() == version_info::Channel::UNKNOWN; | 335 return GetCurrentChannel() == version_info::Channel::UNKNOWN; |
358 } | 336 } |
359 | 337 |
360 // static | 338 // static |
361 ChromeExtensionsClient* ChromeExtensionsClient::GetInstance() { | 339 ChromeExtensionsClient* ChromeExtensionsClient::GetInstance() { |
362 return g_client.Pointer(); | 340 return g_client.Pointer(); |
363 } | 341 } |
364 | 342 |
365 } // namespace extensions | 343 } // namespace extensions |
OLD | NEW |