OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <map> | 10 #include <map> |
(...skipping 24 matching lines...) Expand all Loading... |
35 class ExtensionResource; | 35 class ExtensionResource; |
36 class FileBrowserHandler; | 36 class FileBrowserHandler; |
37 class SkBitmap; | 37 class SkBitmap; |
38 class Version; | 38 class Version; |
39 | 39 |
40 namespace base { | 40 namespace base { |
41 class DictionaryValue; | 41 class DictionaryValue; |
42 class ListValue; | 42 class ListValue; |
43 } | 43 } |
44 | 44 |
45 namespace extensions { | |
46 class Manifest; | |
47 } | |
48 | |
49 namespace webkit_glue { | 45 namespace webkit_glue { |
50 struct WebIntentServiceData; | 46 struct WebIntentServiceData; |
51 } | 47 } |
52 | 48 |
| 49 FORWARD_DECLARE_TEST(TabStripModelTest, Apps); |
| 50 |
| 51 namespace extensions { |
| 52 |
| 53 class Manifest; |
| 54 |
53 // Represents a Chrome extension. | 55 // Represents a Chrome extension. |
54 class Extension : public base::RefCountedThreadSafe<Extension> { | 56 class Extension : public base::RefCountedThreadSafe<Extension> { |
55 public: | 57 public: |
56 typedef std::map<const std::string, GURL> URLOverrideMap; | 58 typedef std::map<const std::string, GURL> URLOverrideMap; |
57 typedef std::vector<std::string> ScriptingWhitelist; | 59 typedef std::vector<std::string> ScriptingWhitelist; |
58 typedef std::vector<linked_ptr<FileBrowserHandler> > FileBrowserHandlerList; | 60 typedef std::vector<linked_ptr<FileBrowserHandler> > FileBrowserHandlerList; |
59 | 61 |
60 // What an extension was loaded from. | 62 // What an extension was loaded from. |
61 // NOTE: These values are stored as integers in the preferences and used | 63 // NOTE: These values are stored as integers in the preferences and used |
62 // in histograms so don't remove or reorder existing items. Just append | 64 // in histograms so don't remove or reorder existing items. Just append |
(...skipping 992 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1055 | 1057 |
1056 // The flags that were passed to InitFromValue. | 1058 // The flags that were passed to InitFromValue. |
1057 int creation_flags_; | 1059 int creation_flags_; |
1058 | 1060 |
1059 // The Content-Security-Policy for this extension. Extensions can use | 1061 // The Content-Security-Policy for this extension. Extensions can use |
1060 // Content-Security-Policies to mitigate cross-site scripting and other | 1062 // Content-Security-Policies to mitigate cross-site scripting and other |
1061 // vulnerabilities. | 1063 // vulnerabilities. |
1062 std::string content_security_policy_; | 1064 std::string content_security_policy_; |
1063 | 1065 |
1064 FRIEND_TEST_ALL_PREFIXES(ExtensionTest, LoadPageActionHelper); | 1066 FRIEND_TEST_ALL_PREFIXES(ExtensionTest, LoadPageActionHelper); |
1065 FRIEND_TEST_ALL_PREFIXES(TabStripModelTest, Apps); | 1067 FRIEND_TEST_ALL_PREFIXES(::TabStripModelTest, Apps); |
1066 | 1068 |
1067 DISALLOW_COPY_AND_ASSIGN(Extension); | 1069 DISALLOW_COPY_AND_ASSIGN(Extension); |
1068 }; | 1070 }; |
1069 | 1071 |
1070 typedef std::vector< scoped_refptr<const Extension> > ExtensionList; | 1072 typedef std::vector< scoped_refptr<const Extension> > ExtensionList; |
1071 typedef std::set<std::string> ExtensionIdSet; | 1073 typedef std::set<std::string> ExtensionIdSet; |
1072 | 1074 |
1073 // Handy struct to pass core extension info around. | 1075 // Handy struct to pass core extension info around. |
1074 struct ExtensionInfo { | 1076 struct ExtensionInfo { |
1075 ExtensionInfo(const base::DictionaryValue* manifest, | 1077 ExtensionInfo(const base::DictionaryValue* manifest, |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1117 // only the permissions that have added, and for Reason::REMOVED, this would | 1119 // only the permissions that have added, and for Reason::REMOVED, this would |
1118 // only contain the removed permissions. | 1120 // only contain the removed permissions. |
1119 const ExtensionPermissionSet* permissions; | 1121 const ExtensionPermissionSet* permissions; |
1120 | 1122 |
1121 UpdatedExtensionPermissionsInfo( | 1123 UpdatedExtensionPermissionsInfo( |
1122 const Extension* extension, | 1124 const Extension* extension, |
1123 const ExtensionPermissionSet* permissions, | 1125 const ExtensionPermissionSet* permissions, |
1124 Reason reason); | 1126 Reason reason); |
1125 }; | 1127 }; |
1126 | 1128 |
| 1129 } // namespace extensions |
| 1130 |
1127 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ | 1131 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ |
OLD | NEW |