Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(848)

Side by Side Diff: chrome/common/extensions/extension.h

Issue 10375021: Move Extension into extensions namespace (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Take 2 Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 985 matching lines...) Expand 10 before | Expand all | Expand 10 after
1048 1050
1049 // The flags that were passed to InitFromValue. 1051 // The flags that were passed to InitFromValue.
1050 int creation_flags_; 1052 int creation_flags_;
1051 1053
1052 // The Content-Security-Policy for this extension. Extensions can use 1054 // The Content-Security-Policy for this extension. Extensions can use
1053 // Content-Security-Policies to mitigate cross-site scripting and other 1055 // Content-Security-Policies to mitigate cross-site scripting and other
1054 // vulnerabilities. 1056 // vulnerabilities.
1055 std::string content_security_policy_; 1057 std::string content_security_policy_;
1056 1058
1057 FRIEND_TEST_ALL_PREFIXES(ExtensionTest, LoadPageActionHelper); 1059 FRIEND_TEST_ALL_PREFIXES(ExtensionTest, LoadPageActionHelper);
1058 FRIEND_TEST_ALL_PREFIXES(TabStripModelTest, Apps); 1060 FRIEND_TEST_ALL_PREFIXES(::TabStripModelTest, Apps);
1059 1061
1060 DISALLOW_COPY_AND_ASSIGN(Extension); 1062 DISALLOW_COPY_AND_ASSIGN(Extension);
1061 }; 1063 };
1062 1064
1063 typedef std::vector< scoped_refptr<const Extension> > ExtensionList; 1065 typedef std::vector< scoped_refptr<const Extension> > ExtensionList;
1064 typedef std::set<std::string> ExtensionIdSet; 1066 typedef std::set<std::string> ExtensionIdSet;
1065 1067
1066 // Handy struct to pass core extension info around. 1068 // Handy struct to pass core extension info around.
1067 struct ExtensionInfo { 1069 struct ExtensionInfo {
1068 ExtensionInfo(const base::DictionaryValue* manifest, 1070 ExtensionInfo(const base::DictionaryValue* manifest,
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
1110 // only the permissions that have added, and for Reason::REMOVED, this would 1112 // only the permissions that have added, and for Reason::REMOVED, this would
1111 // only contain the removed permissions. 1113 // only contain the removed permissions.
1112 const ExtensionPermissionSet* permissions; 1114 const ExtensionPermissionSet* permissions;
1113 1115
1114 UpdatedExtensionPermissionsInfo( 1116 UpdatedExtensionPermissionsInfo(
1115 const Extension* extension, 1117 const Extension* extension,
1116 const ExtensionPermissionSet* permissions, 1118 const ExtensionPermissionSet* permissions,
1117 Reason reason); 1119 Reason reason);
1118 }; 1120 };
1119 1121
1122 } // namespace extensions
1123
1120 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ 1124 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698