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

Side by Side Diff: extensions/common/extensions_client.h

Issue 296133011: Move extension API schema registration to ExtensionsClient. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ifdefs =( Created 6 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « extensions/common/extension_api.cc ('k') | extensions/test/test_extensions_client.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #ifndef EXTENSIONS_COMMON_EXTENSIONS_CLIENT_H_ 5 #ifndef EXTENSIONS_COMMON_EXTENSIONS_CLIENT_H_
6 #define EXTENSIONS_COMMON_EXTENSIONS_CLIENT_H_ 6 #define EXTENSIONS_COMMON_EXTENSIONS_CLIENT_H_
7 7
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/memory/scoped_ptr.h" 12 #include "base/memory/scoped_ptr.h"
13 #include "base/strings/string_piece.h" 13 #include "base/strings/string_piece.h"
14 14
15 class GURL; 15 class GURL;
16 16
17 namespace extensions { 17 namespace extensions {
18 18
19 class APIPermissionSet; 19 class APIPermissionSet;
20 class Extension; 20 class Extension;
21 class ExtensionAPI;
21 class FeatureProvider; 22 class FeatureProvider;
22 class JSONFeatureProviderSource; 23 class JSONFeatureProviderSource;
23 class ManifestPermissionSet; 24 class ManifestPermissionSet;
24 class PermissionMessage; 25 class PermissionMessage;
25 class PermissionMessageProvider; 26 class PermissionMessageProvider;
26 class SimpleFeature; 27 class SimpleFeature;
27 class URLPatternSet; 28 class URLPatternSet;
28 29
29 // Sets up global state for the extensions system. Should be Set() once in each 30 // Sets up global state for the extensions system. Should be Set() once in each
30 // process. This should be implemented by the client of the extensions system. 31 // process. This should be implemented by the client of the extensions system.
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 virtual URLPatternSet GetPermittedChromeSchemeHosts( 76 virtual URLPatternSet GetPermittedChromeSchemeHosts(
76 const Extension* extension, 77 const Extension* extension,
77 const APIPermissionSet& api_permissions) const = 0; 78 const APIPermissionSet& api_permissions) const = 0;
78 79
79 // Returns false if content scripts are forbidden from running on |url|. 80 // Returns false if content scripts are forbidden from running on |url|.
80 virtual bool IsScriptableURL(const GURL& url, std::string* error) const = 0; 81 virtual bool IsScriptableURL(const GURL& url, std::string* error) const = 0;
81 82
82 // Returns true iff a schema named |name| is generated. 83 // Returns true iff a schema named |name| is generated.
83 virtual bool IsAPISchemaGenerated(const std::string& name) const = 0; 84 virtual bool IsAPISchemaGenerated(const std::string& name) const = 0;
84 85
85 // Gets the API schema named |name|. 86 // Gets the generated API schema named |name|.
86 virtual base::StringPiece GetAPISchema(const std::string& name) const = 0; 87 virtual base::StringPiece GetAPISchema(const std::string& name) const = 0;
87 88
89 // Register non-generated API schema resources with the global ExtensionAPI.
90 // Called when the ExtensionAPI is lazily initialized.
91 virtual void RegisterAPISchemaResources(ExtensionAPI* api) const = 0;
92
88 // Determines if certain fatal extensions errors should be surpressed 93 // Determines if certain fatal extensions errors should be surpressed
89 // (i.e., only logged) or allowed (i.e., logged before crashing). 94 // (i.e., only logged) or allowed (i.e., logged before crashing).
90 virtual bool ShouldSuppressFatalErrors() const = 0; 95 virtual bool ShouldSuppressFatalErrors() const = 0;
91 96
92 // Return the extensions client. 97 // Return the extensions client.
93 static ExtensionsClient* Get(); 98 static ExtensionsClient* Get();
94 99
95 // Initialize the extensions system with this extensions client. 100 // Initialize the extensions system with this extensions client.
96 static void Set(ExtensionsClient* client); 101 static void Set(ExtensionsClient* client);
97 }; 102 };
98 103
99 } // namespace extensions 104 } // namespace extensions
100 105
101 #endif // EXTENSIONS_COMMON_EXTENSIONS_CLIENT_H_ 106 #endif // EXTENSIONS_COMMON_EXTENSIONS_CLIENT_H_
OLDNEW
« no previous file with comments | « extensions/common/extension_api.cc ('k') | extensions/test/test_extensions_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698