Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Side by Side Diff: chrome/common/extensions/chrome_extensions_client.cc

Issue 1226353004: Generate all extension schema namespaces as "api" and instead vary the generated bundle names. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/metrics/histogram_macros.h" 9 #include "base/metrics/histogram_macros.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 if (error) 281 if (error)
282 *error = manifest_errors::kCannotScriptGallery; 282 *error = manifest_errors::kCannotScriptGallery;
283 return false; 283 return false;
284 } 284 }
285 return true; 285 return true;
286 } 286 }
287 287
288 bool ChromeExtensionsClient::IsAPISchemaGenerated( 288 bool ChromeExtensionsClient::IsAPISchemaGenerated(
289 const std::string& name) const { 289 const std::string& name) const {
290 // Test from most common to least common. 290 // Test from most common to least common.
291 return api::GeneratedSchemas::IsGenerated(name) || 291 return api::ChromeGeneratedSchemas::IsGenerated(name) ||
292 core_api::GeneratedSchemas::IsGenerated(name); 292 api::GeneratedSchemas::IsGenerated(name);
293 } 293 }
294 294
295 base::StringPiece ChromeExtensionsClient::GetAPISchema( 295 base::StringPiece ChromeExtensionsClient::GetAPISchema(
296 const std::string& name) const { 296 const std::string& name) const {
297 // Test from most common to least common. 297 // Test from most common to least common.
298 if (api::GeneratedSchemas::IsGenerated(name)) 298 if (api::ChromeGeneratedSchemas::IsGenerated(name))
299 return api::GeneratedSchemas::Get(name); 299 return api::ChromeGeneratedSchemas::Get(name);
300 300
301 return core_api::GeneratedSchemas::Get(name); 301 return api::GeneratedSchemas::Get(name);
302 } 302 }
303 303
304 void ChromeExtensionsClient::RegisterAPISchemaResources( 304 void ChromeExtensionsClient::RegisterAPISchemaResources(
305 ExtensionAPI* api) const { 305 ExtensionAPI* api) const {
306 api->RegisterSchemaResource("accessibilityPrivate", 306 api->RegisterSchemaResource("accessibilityPrivate",
307 IDR_EXTENSION_API_JSON_ACCESSIBILITYPRIVATE); 307 IDR_EXTENSION_API_JSON_ACCESSIBILITYPRIVATE);
308 api->RegisterSchemaResource("app", IDR_EXTENSION_API_JSON_APP); 308 api->RegisterSchemaResource("app", IDR_EXTENSION_API_JSON_APP);
309 api->RegisterSchemaResource("browserAction", 309 api->RegisterSchemaResource("browserAction",
310 IDR_EXTENSION_API_JSON_BROWSERACTION); 310 IDR_EXTENSION_API_JSON_BROWSERACTION);
311 api->RegisterSchemaResource("commands", IDR_EXTENSION_API_JSON_COMMANDS); 311 api->RegisterSchemaResource("commands", IDR_EXTENSION_API_JSON_COMMANDS);
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
402 402
403 return image_paths; 403 return image_paths;
404 } 404 }
405 405
406 // static 406 // static
407 ChromeExtensionsClient* ChromeExtensionsClient::GetInstance() { 407 ChromeExtensionsClient* ChromeExtensionsClient::GetInstance() {
408 return g_client.Pointer(); 408 return g_client.Pointer();
409 } 409 }
410 410
411 } // namespace extensions 411 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/common/extensions/api/schemas.gypi ('k') | extensions/browser/api/alarms/alarm_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698