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 EXTENSIONS_COMMON_EXTENSION_H_ | 5 #ifndef EXTENSIONS_COMMON_EXTENSION_H_ |
6 #define EXTENSIONS_COMMON_EXTENSION_H_ | 6 #define EXTENSIONS_COMMON_EXTENSION_H_ |
7 | 7 |
8 #include <algorithm> | 8 #include <algorithm> |
9 #include <iosfwd> | 9 #include <iosfwd> |
10 #include <map> | 10 #include <map> |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
344 bool is_legacy_packaged_app() const; | 344 bool is_legacy_packaged_app() const; |
345 bool is_extension() const; | 345 bool is_extension() const; |
346 bool is_shared_module() const; | 346 bool is_shared_module() const; |
347 bool is_theme() const; | 347 bool is_theme() const; |
348 | 348 |
349 bool can_be_incognito_enabled() const; | 349 bool can_be_incognito_enabled() const; |
350 | 350 |
351 void AddWebExtentPattern(const URLPattern& pattern); | 351 void AddWebExtentPattern(const URLPattern& pattern); |
352 const URLPatternSet& web_extent() const { return extent_; } | 352 const URLPatternSet& web_extent() const { return extent_; } |
353 | 353 |
354 // Updates the set of architectures for which this extension has platform- | |
355 // specific resources installed. | |
356 void SetPlatformSpecificResourceArchs(const std::set<std::string>& archs); | |
Yoyo Zhou
2014/09/04 02:14:23
Does this really need to be stored on Extension? I
| |
357 | |
358 // Retrieves the set of architectures for which this extension has | |
359 // platform-specific resources installed. | |
360 void GetPlatformSpecificResourceArchs(std::set<std::string>* archs) const; | |
361 | |
354 private: | 362 private: |
355 friend class base::RefCountedThreadSafe<Extension>; | 363 friend class base::RefCountedThreadSafe<Extension>; |
356 | 364 |
357 // Chooses the extension ID for an extension based on a variety of criteria. | 365 // Chooses the extension ID for an extension based on a variety of criteria. |
358 // The chosen ID will be set in |manifest|. | 366 // The chosen ID will be set in |manifest|. |
359 static bool InitExtensionID(extensions::Manifest* manifest, | 367 static bool InitExtensionID(extensions::Manifest* manifest, |
360 const base::FilePath& path, | 368 const base::FilePath& path, |
361 const ExtensionId& explicit_id, | 369 const ExtensionId& explicit_id, |
362 int creation_flags, | 370 int creation_flags, |
363 base::string16* error); | 371 base::string16* error); |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
473 bool display_in_new_tab_page_; | 481 bool display_in_new_tab_page_; |
474 | 482 |
475 // Whether the extension has host permissions or user script patterns that | 483 // Whether the extension has host permissions or user script patterns that |
476 // imply access to file:/// scheme URLs (the user may not have actually | 484 // imply access to file:/// scheme URLs (the user may not have actually |
477 // granted it that access). | 485 // granted it that access). |
478 bool wants_file_access_; | 486 bool wants_file_access_; |
479 | 487 |
480 // The flags that were passed to InitFromValue. | 488 // The flags that were passed to InitFromValue. |
481 int creation_flags_; | 489 int creation_flags_; |
482 | 490 |
491 // The set of archs for which platform-specific resources are present in | |
492 // this extension installation. Null if these have not been identified yet. | |
493 std::set<std::string> platform_specific_resource_archs_; | |
494 | |
483 DISALLOW_COPY_AND_ASSIGN(Extension); | 495 DISALLOW_COPY_AND_ASSIGN(Extension); |
484 }; | 496 }; |
485 | 497 |
486 typedef std::vector<scoped_refptr<const Extension> > ExtensionList; | 498 typedef std::vector<scoped_refptr<const Extension> > ExtensionList; |
487 typedef std::set<ExtensionId> ExtensionIdSet; | 499 typedef std::set<ExtensionId> ExtensionIdSet; |
488 typedef std::vector<ExtensionId> ExtensionIdList; | 500 typedef std::vector<ExtensionId> ExtensionIdList; |
489 | 501 |
490 // Handy struct to pass core extension info around. | 502 // Handy struct to pass core extension info around. |
491 struct ExtensionInfo { | 503 struct ExtensionInfo { |
492 ExtensionInfo(const base::DictionaryValue* manifest, | 504 ExtensionInfo(const base::DictionaryValue* manifest, |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
564 | 576 |
565 UpdatedExtensionPermissionsInfo( | 577 UpdatedExtensionPermissionsInfo( |
566 const Extension* extension, | 578 const Extension* extension, |
567 const PermissionSet* permissions, | 579 const PermissionSet* permissions, |
568 Reason reason); | 580 Reason reason); |
569 }; | 581 }; |
570 | 582 |
571 } // namespace extensions | 583 } // namespace extensions |
572 | 584 |
573 #endif // EXTENSIONS_COMMON_EXTENSION_H_ | 585 #endif // EXTENSIONS_COMMON_EXTENSION_H_ |
OLD | NEW |