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 <map> | 8 #include <map> |
9 #include <memory> | 9 #include <memory> |
10 #include <set> | 10 #include <set> |
11 #include <string> | 11 #include <string> |
12 #include <vector> | 12 #include <vector> |
13 | 13 |
14 #include "base/files/file_path.h" | 14 #include "base/files/file_path.h" |
15 #include "base/macros.h" | 15 #include "base/macros.h" |
16 #include "base/memory/linked_ptr.h" | 16 #include "base/memory/linked_ptr.h" |
17 #include "base/memory/ref_counted.h" | 17 #include "base/memory/ref_counted.h" |
18 #include "base/threading/thread_checker.h" | 18 #include "base/threading/thread_checker.h" |
| 19 #include "extensions/common/extension_id.h" |
19 #include "extensions/common/extension_resource.h" | 20 #include "extensions/common/extension_resource.h" |
20 #include "extensions/common/install_warning.h" | 21 #include "extensions/common/install_warning.h" |
21 #include "extensions/common/manifest.h" | 22 #include "extensions/common/manifest.h" |
22 #include "extensions/common/url_pattern_set.h" | 23 #include "extensions/common/url_pattern_set.h" |
23 #include "url/gurl.h" | 24 #include "url/gurl.h" |
24 | 25 |
25 #if !defined(ENABLE_EXTENSIONS) | 26 #if !defined(ENABLE_EXTENSIONS) |
26 #error "Extensions must be enabled" | 27 #error "Extensions must be enabled" |
27 #endif | 28 #endif |
28 | 29 |
29 namespace base { | 30 namespace base { |
30 class DictionaryValue; | 31 class DictionaryValue; |
31 class Version; | 32 class Version; |
32 } | 33 } |
33 | 34 |
34 namespace extensions { | 35 namespace extensions { |
35 class PermissionSet; | 36 class PermissionSet; |
36 class PermissionsData; | 37 class PermissionsData; |
37 class PermissionsParser; | 38 class PermissionsParser; |
38 | 39 |
39 // Uniquely identifies an Extension, using 32 characters from the alphabet | |
40 // 'a'-'p'. An empty string represents "no extension". | |
41 // | |
42 // Note: If this gets used heavily in files that don't otherwise need to include | |
43 // extension.h, we should pull it into a dedicated header. | |
44 typedef std::string ExtensionId; | |
45 | |
46 // Represents a Chrome extension. | 40 // Represents a Chrome extension. |
47 // Once created, an Extension object is immutable, with the exception of its | 41 // Once created, an Extension object is immutable, with the exception of its |
48 // RuntimeData. This makes it safe to use on any thread, since access to the | 42 // RuntimeData. This makes it safe to use on any thread, since access to the |
49 // RuntimeData is protected by a lock. | 43 // RuntimeData is protected by a lock. |
50 class Extension : public base::RefCountedThreadSafe<Extension> { | 44 class Extension : public base::RefCountedThreadSafe<Extension> { |
51 public: | 45 public: |
52 enum State { | 46 enum State { |
53 DISABLED = 0, | 47 DISABLED = 0, |
54 ENABLED, | 48 ENABLED, |
55 // An external extension that the user uninstalled. We should not reinstall | 49 // An external extension that the user uninstalled. We should not reinstall |
(...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
562 const PermissionSet& permissions; | 556 const PermissionSet& permissions; |
563 | 557 |
564 UpdatedExtensionPermissionsInfo(const Extension* extension, | 558 UpdatedExtensionPermissionsInfo(const Extension* extension, |
565 const PermissionSet& permissions, | 559 const PermissionSet& permissions, |
566 Reason reason); | 560 Reason reason); |
567 }; | 561 }; |
568 | 562 |
569 } // namespace extensions | 563 } // namespace extensions |
570 | 564 |
571 #endif // EXTENSIONS_COMMON_EXTENSION_H_ | 565 #endif // EXTENSIONS_COMMON_EXTENSION_H_ |
OLD | NEW |