OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_EXTENSION_H_ | 5 #ifndef CHROME_COMMON_EXTENSIONS_EXTENSION_H_ |
6 #define CHROME_COMMON_EXTENSIONS_EXTENSION_H_ | 6 #define CHROME_COMMON_EXTENSIONS_EXTENSION_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 const std::string& public_key() const { return public_key_; } | 192 const std::string& public_key() const { return public_key_; } |
193 const std::string& description() const { return description_; } | 193 const std::string& description() const { return description_; } |
194 const UserScriptList& content_scripts() const { return content_scripts_; } | 194 const UserScriptList& content_scripts() const { return content_scripts_; } |
195 const PageActionMap& page_actions() const { return page_actions_; } | 195 const PageActionMap& page_actions() const { return page_actions_; } |
196 const std::vector<PrivacyBlacklistInfo>& privacy_blacklists() const { | 196 const std::vector<PrivacyBlacklistInfo>& privacy_blacklists() const { |
197 return privacy_blacklists_; | 197 return privacy_blacklists_; |
198 } | 198 } |
199 const std::vector<PluginInfo>& plugins() const { return plugins_; } | 199 const std::vector<PluginInfo>& plugins() const { return plugins_; } |
200 const GURL& background_url() const { return background_url_; } | 200 const GURL& background_url() const { return background_url_; } |
201 const std::vector<ToolstripInfo>& toolstrips() const { return toolstrips_; } | 201 const std::vector<ToolstripInfo>& toolstrips() const { return toolstrips_; } |
| 202 const std::vector<std::string>& api_permissions() const { |
| 203 return api_permissions_; |
| 204 } |
202 const HostPermissions& host_permissions() const { | 205 const HostPermissions& host_permissions() const { |
203 return host_permissions_; | 206 return host_permissions_; |
204 } | 207 } |
205 const std::vector<std::string>& api_permissions() const { | 208 |
206 return api_permissions_; | 209 // Returns true if the extension has permission to access the host for the |
207 } | 210 // specified URL. |
| 211 bool CanAccessHost(const GURL& url) const; |
208 | 212 |
209 // Returns the set of hosts that the extension effectively has access to. This | 213 // Returns the set of hosts that the extension effectively has access to. This |
210 // is used in the permissions UI and is a combination of the hosts accessible | 214 // is used in the permissions UI and is a combination of the hosts accessible |
211 // through content scripts and the hosts accessible through XHR. | 215 // through content scripts and the hosts accessible through XHR. |
212 const std::set<std::string> GetEffectiveHostPermissions() const; | 216 const std::set<std::string> GetEffectiveHostPermissions() const; |
213 | 217 |
214 // Whether the extension has access to all hosts. This is true if there is | 218 // Whether the extension has access to all hosts. This is true if there is |
215 // a content script that matches all hosts, or if there is a host permission | 219 // a content script that matches all hosts, or if there is a host permission |
216 // for all hosts. | 220 // for all hosts. |
217 bool HasAccessToAllHosts() const; | 221 bool HasAccessToAllHosts() const; |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
395 | 399 |
396 // True if the background page is ready. | 400 // True if the background page is ready. |
397 bool background_page_ready_; | 401 bool background_page_ready_; |
398 | 402 |
399 FRIEND_TEST(ExtensionTest, LoadPageActionHelper); | 403 FRIEND_TEST(ExtensionTest, LoadPageActionHelper); |
400 | 404 |
401 DISALLOW_COPY_AND_ASSIGN(Extension); | 405 DISALLOW_COPY_AND_ASSIGN(Extension); |
402 }; | 406 }; |
403 | 407 |
404 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ | 408 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ |
OLD | NEW |