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

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

Issue 159483: Revert 21800 - Merge 21612 Implement mimetype sniffing for extensions.... (Closed) Base URL: svn://chrome-svn/chrome/branches/195/src/
Patch Set: Created 11 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/download/save_package.cc ('k') | chrome/common/extensions/extension.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Modified: svn:mergeinfo
Reverse-merged /trunk/src/chrome/common/extensions/extension.h:r21612
Reverse-merged /branches/chrome_webkit_merge_branch/chrome/common/extensions/extension.h:r69-2775
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 // The name of the manifest inside an extension. 57 // The name of the manifest inside an extension.
58 static const char kManifestFilename[]; 58 static const char kManifestFilename[];
59 59
60 #if defined(OS_WIN) 60 #if defined(OS_WIN)
61 static const char* kExtensionRegistryPath; 61 static const char* kExtensionRegistryPath;
62 #endif 62 #endif
63 63
64 // The number of bytes in a legal id. 64 // The number of bytes in a legal id.
65 static const size_t kIdSize; 65 static const size_t kIdSize;
66 66
67 // The mimetype used for extensions.
68 static const char kMimeType[];
69
70 Extension() : location_(INVALID), is_theme_(false) {} 67 Extension() : location_(INVALID), is_theme_(false) {}
71 explicit Extension(const FilePath& path); 68 explicit Extension(const FilePath& path);
72 virtual ~Extension(); 69 virtual ~Extension();
73 70
71 // Returns true if the specified file is an extension.
72 static bool IsExtension(const FilePath& file_name);
73
74 // Resets the id counter. This is only useful for unit tests. 74 // Resets the id counter. This is only useful for unit tests.
75 static void ResetGeneratedIdCounter() { 75 static void ResetGeneratedIdCounter() {
76 id_counter_ = 0; 76 id_counter_ = 0;
77 } 77 }
78 78
79 // Checks to see if the extension has a valid ID. 79 // Checks to see if the extension has a valid ID.
80 static bool IdIsValid(const std::string& id); 80 static bool IdIsValid(const std::string& id);
81 81
82 // Returns true if the specified file is an extension.
83 static bool IsExtension(const FilePath& file_name);
84
85 // Whether the |location| is external or not. 82 // Whether the |location| is external or not.
86 static inline bool IsExternalLocation(Location location) { 83 static inline bool IsExternalLocation(Location location) {
87 return location == Extension::EXTERNAL_PREF || 84 return location == Extension::EXTERNAL_PREF ||
88 location == Extension::EXTERNAL_REGISTRY; 85 location == Extension::EXTERNAL_REGISTRY;
89 } 86 }
90 87
91 // Returns an absolute url to a resource inside of an extension. The 88 // Returns an absolute url to a resource inside of an extension. The
92 // |extension_url| argument should be the url() from an Extension object. The 89 // |extension_url| argument should be the url() from an Extension object. The
93 // |relative_path| can be untrusted user input. The returned URL will either 90 // |relative_path| can be untrusted user input. The returned URL will either
94 // be invalid() or a child of |extension_url|. 91 // be invalid() or a child of |extension_url|.
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 267
271 // URL for fetching an update manifest 268 // URL for fetching an update manifest
272 GURL update_url_; 269 GURL update_url_;
273 270
274 FRIEND_TEST(ExtensionTest, LoadPageActionHelper); 271 FRIEND_TEST(ExtensionTest, LoadPageActionHelper);
275 272
276 DISALLOW_COPY_AND_ASSIGN(Extension); 273 DISALLOW_COPY_AND_ASSIGN(Extension);
277 }; 274 };
278 275
279 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ 276 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_
OLDNEW
« no previous file with comments | « chrome/browser/download/save_package.cc ('k') | chrome/common/extensions/extension.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698