| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 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 <algorithm> | 8 #include <algorithm> |
| 9 #include <iosfwd> | 9 #include <iosfwd> |
| 10 #include <map> | 10 #include <map> |
| (...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 // else. | 303 // else. |
| 304 void set_wants_file_access(bool wants_file_access) { | 304 void set_wants_file_access(bool wants_file_access) { |
| 305 wants_file_access_ = wants_file_access; | 305 wants_file_access_ = wants_file_access; |
| 306 } | 306 } |
| 307 int creation_flags() const { return creation_flags_; } | 307 int creation_flags() const { return creation_flags_; } |
| 308 bool from_webstore() const { return (creation_flags_ & FROM_WEBSTORE) != 0; } | 308 bool from_webstore() const { return (creation_flags_ & FROM_WEBSTORE) != 0; } |
| 309 bool from_bookmark() const { return (creation_flags_ & FROM_BOOKMARK) != 0; } | 309 bool from_bookmark() const { return (creation_flags_ & FROM_BOOKMARK) != 0; } |
| 310 bool was_installed_by_default() const { | 310 bool was_installed_by_default() const { |
| 311 return (creation_flags_ & WAS_INSTALLED_BY_DEFAULT) != 0; | 311 return (creation_flags_ & WAS_INSTALLED_BY_DEFAULT) != 0; |
| 312 } | 312 } |
| 313 int image_id() const { return image_id_; } |
| 313 | 314 |
| 314 // App-related. | 315 // App-related. |
| 315 bool is_app() const; | 316 bool is_app() const; |
| 316 bool is_platform_app() const; | 317 bool is_platform_app() const; |
| 317 bool is_hosted_app() const; | 318 bool is_hosted_app() const; |
| 318 bool is_legacy_packaged_app() const; | 319 bool is_legacy_packaged_app() const; |
| 319 bool is_extension() const; | 320 bool is_extension() const; |
| 320 bool can_be_incognito_enabled() const; | 321 bool can_be_incognito_enabled() const; |
| 321 | 322 |
| 322 void AddWebExtentPattern(const URLPattern& pattern); | 323 void AddWebExtentPattern(const URLPattern& pattern); |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 436 bool display_in_new_tab_page_; | 437 bool display_in_new_tab_page_; |
| 437 | 438 |
| 438 // Whether the extension has host permissions or user script patterns that | 439 // Whether the extension has host permissions or user script patterns that |
| 439 // imply access to file:/// scheme URLs (the user may not have actually | 440 // imply access to file:/// scheme URLs (the user may not have actually |
| 440 // granted it that access). | 441 // granted it that access). |
| 441 bool wants_file_access_; | 442 bool wants_file_access_; |
| 442 | 443 |
| 443 // The flags that were passed to InitFromValue. | 444 // The flags that were passed to InitFromValue. |
| 444 int creation_flags_; | 445 int creation_flags_; |
| 445 | 446 |
| 447 // The randomly generated ID used to identify if an image needs to be |
| 448 // cached again when reloaded. |
| 449 int image_id_; |
| 450 |
| 446 DISALLOW_COPY_AND_ASSIGN(Extension); | 451 DISALLOW_COPY_AND_ASSIGN(Extension); |
| 447 }; | 452 }; |
| 448 | 453 |
| 449 typedef std::vector<scoped_refptr<const Extension> > ExtensionList; | 454 typedef std::vector<scoped_refptr<const Extension> > ExtensionList; |
| 450 typedef std::set<std::string> ExtensionIdSet; | 455 typedef std::set<std::string> ExtensionIdSet; |
| 451 typedef std::vector<std::string> ExtensionIdList; | 456 typedef std::vector<std::string> ExtensionIdList; |
| 452 | 457 |
| 453 // Handy struct to pass core extension info around. | 458 // Handy struct to pass core extension info around. |
| 454 struct ExtensionInfo { | 459 struct ExtensionInfo { |
| 455 ExtensionInfo(const base::DictionaryValue* manifest, | 460 ExtensionInfo(const base::DictionaryValue* manifest, |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 516 | 521 |
| 517 UpdatedExtensionPermissionsInfo( | 522 UpdatedExtensionPermissionsInfo( |
| 518 const Extension* extension, | 523 const Extension* extension, |
| 519 const PermissionSet* permissions, | 524 const PermissionSet* permissions, |
| 520 Reason reason); | 525 Reason reason); |
| 521 }; | 526 }; |
| 522 | 527 |
| 523 } // namespace extensions | 528 } // namespace extensions |
| 524 | 529 |
| 525 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ | 530 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ |
| OLD | NEW |