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

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

Issue 109683007: Pass a Feature* to IsAnyFeatureAvailableToContext instead of a string name. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update extension_api_stub.cc Created 7 years 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 | « chrome/renderer/extensions/dispatcher.cc ('k') | extensions/common/extension_api.cc » ('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_EXTENSION_API_H_ 5 #ifndef EXTENSIONS_COMMON_EXTENSION_API_H_
6 #define EXTENSIONS_COMMON_EXTENSION_API_H_ 6 #define EXTENSIONS_COMMON_EXTENSION_API_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 10
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 // either a namespace name (like "bookmarks") or a member name (like 69 // either a namespace name (like "bookmarks") or a member name (like
70 // "bookmarks.create"). Returns true if the feature and all of its 70 // "bookmarks.create"). Returns true if the feature and all of its
71 // dependencies are available to the specified context. 71 // dependencies are available to the specified context.
72 Feature::Availability IsAvailable(const std::string& api_full_name, 72 Feature::Availability IsAvailable(const std::string& api_full_name,
73 const Extension* extension, 73 const Extension* extension,
74 Feature::Context context, 74 Feature::Context context,
75 const GURL& url); 75 const GURL& url);
76 76
77 // Determines whether an API, or any parts of that API, are available in 77 // Determines whether an API, or any parts of that API, are available in
78 // |context|. 78 // |context|.
79 bool IsAnyFeatureAvailableToContext(const std::string& api_name, 79 bool IsAnyFeatureAvailableToContext(const Feature& api,
80 const Extension* extension, 80 const Extension* extension,
81 Feature::Context context, 81 Feature::Context context,
82 const GURL& url); 82 const GURL& url);
83 83
84 // Returns true if |name| is a privileged API path. Privileged paths can only 84 // Returns true if |name| is a privileged API path. Privileged paths can only
85 // be called from extension code which is running in its own designated 85 // be called from extension code which is running in its own designated
86 // extension process. They cannot be called from extension code running in 86 // extension process. They cannot be called from extension code running in
87 // content scripts, or other low-privileged contexts. 87 // content scripts, or other low-privileged contexts.
88 bool IsPrivileged(const std::string& name); 88 bool IsPrivileged(const std::string& name);
89 89
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 // FeatureProviders used for resolving dependencies. 132 // FeatureProviders used for resolving dependencies.
133 typedef std::map<std::string, FeatureProvider*> FeatureProviderMap; 133 typedef std::map<std::string, FeatureProvider*> FeatureProviderMap;
134 FeatureProviderMap dependency_providers_; 134 FeatureProviderMap dependency_providers_;
135 135
136 DISALLOW_COPY_AND_ASSIGN(ExtensionAPI); 136 DISALLOW_COPY_AND_ASSIGN(ExtensionAPI);
137 }; 137 };
138 138
139 } // namespace extensions 139 } // namespace extensions
140 140
141 #endif // EXTENSIONS_COMMON_EXTENSION_API_H_ 141 #endif // EXTENSIONS_COMMON_EXTENSION_API_H_
OLDNEW
« no previous file with comments | « chrome/renderer/extensions/dispatcher.cc ('k') | extensions/common/extension_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698