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

Side by Side Diff: chrome/common/extensions/api/extension_api.h

Issue 14494013: Allow API functions and events to have entries in _api_features.json (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 CHROME_COMMON_EXTENSIONS_API_EXTENSION_API_H_ 5 #ifndef CHROME_COMMON_EXTENSIONS_API_EXTENSION_API_H_
6 #define CHROME_COMMON_EXTENSIONS_API_EXTENSION_API_H_ 6 #define CHROME_COMMON_EXTENSIONS_API_EXTENSION_API_H_
7 7
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 69
70 // Returns true if the specified API is available. |api_full_name| can be 70 // Returns true if the specified API is available. |api_full_name| can be
71 // either a namespace name (like "bookmarks") or a member name (like 71 // either a namespace name (like "bookmarks") or a member name (like
72 // "bookmarks.create"). Returns true if the feature and all of its 72 // "bookmarks.create"). Returns true if the feature and all of its
73 // dependencies are available to the specified context. 73 // dependencies are available to the specified context.
74 Feature::Availability IsAvailable(const std::string& api_full_name, 74 Feature::Availability IsAvailable(const std::string& api_full_name,
75 const Extension* extension, 75 const Extension* extension,
76 Feature::Context context, 76 Feature::Context context,
77 const GURL& url); 77 const GURL& url);
78 78
79 // Determines whether an API, or any parts of that API, are available in
80 // |context|.
81 Feature::Availability IsPartAvailableToContext(const std::string& api_name,
82 Feature::Context context,
83 const GURL& url);
84
79 // Returns true if |name| is a privileged API path. Privileged paths can only 85 // Returns true if |name| is a privileged API path. Privileged paths can only
80 // be called from extension code which is running in its own designated 86 // be called from extension code which is running in its own designated
81 // extension process. They cannot be called from extension code running in 87 // extension process. They cannot be called from extension code running in
82 // content scripts, or other low-privileged contexts. 88 // content scripts, or other low-privileged contexts.
83 bool IsPrivileged(const std::string& name); 89 bool IsPrivileged(const std::string& name);
84 90
85 // Gets the schema for the extension API with namespace |full_name|. 91 // Gets the schema for the extension API with namespace |full_name|.
86 // Ownership remains with this object. 92 // Ownership remains with this object.
87 const base::DictionaryValue* GetSchema(const std::string& full_name); 93 const base::DictionaryValue* GetSchema(const std::string& full_name);
88 94
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 // FeatureProviders used for resolving dependencies. 169 // FeatureProviders used for resolving dependencies.
164 typedef std::map<std::string, FeatureProvider*> FeatureProviderMap; 170 typedef std::map<std::string, FeatureProvider*> FeatureProviderMap;
165 FeatureProviderMap dependency_providers_; 171 FeatureProviderMap dependency_providers_;
166 172
167 DISALLOW_COPY_AND_ASSIGN(ExtensionAPI); 173 DISALLOW_COPY_AND_ASSIGN(ExtensionAPI);
168 }; 174 };
169 175
170 } // extensions 176 } // extensions
171 177
172 #endif // CHROME_COMMON_EXTENSIONS_API_EXTENSION_API_H_ 178 #endif // CHROME_COMMON_EXTENSIONS_API_EXTENSION_API_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698