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

Side by Side Diff: components/crx_file/id_util.h

Issue 481433005: Extensions: Move id_util functions to crx_file component. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: revert last patchset. function returns Extension* and can't use an assert. Created 6 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 | « components/crx_file/DEPS ('k') | components/crx_file/id_util.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_ID_UTIL_H_ 5 #ifndef COMPONENTS_CRX_FILE_ID_UTIL_H_
6 #define EXTENSIONS_COMMON_ID_UTIL_H_ 6 #define COMPONENTS_CRX_FILE_ID_UTIL_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 namespace base { 10 namespace base {
11 class FilePath; 11 class FilePath;
12 } 12 }
13 13
14 namespace extensions { 14 namespace crx_file {
15 namespace id_util { 15 namespace id_util {
16 16
17 // The number of bytes in a legal id. 17 // The number of bytes in a legal id.
18 extern const size_t kIdSize; 18 extern const size_t kIdSize;
19 19
20 // Generates an extension ID from arbitrary input. The same input string will 20 // Generates an extension ID from arbitrary input. The same input string will
21 // always generate the same output ID. 21 // always generate the same output ID.
22 std::string GenerateId(const std::string& input); 22 std::string GenerateId(const std::string& input);
23 23
24 // Generate an ID for an extension in the given path. 24 // Generate an ID for an extension in the given path.
25 // Used while developing extensions, before they have a key. 25 // Used while developing extensions, before they have a key.
26 std::string GenerateIdForPath(const base::FilePath& path); 26 std::string GenerateIdForPath(const base::FilePath& path);
27 27
28 // Normalize the path for use by the extension. On Windows, this will make 28 // Normalize the path for use by the extension. On Windows, this will make
29 // sure the drive letter is uppercase. 29 // sure the drive letter is uppercase.
30 base::FilePath MaybeNormalizePath(const base::FilePath& path); 30 base::FilePath MaybeNormalizePath(const base::FilePath& path);
31 31
32 // Checks if |id| is a valid extension-id. Extension-ids are used for anything
33 // that comes in a CRX file, including apps, extensions, and components.
34 bool IdIsValid(const std::string& id);
35
32 } // namespace id_util 36 } // namespace id_util
33 } // namespace extensions 37 } // namespace crx_file
34 38
35 #endif // EXTENSIONS_COMMON_ID_UTIL_H_ 39 #endif // COMPONENTS_CRX_FILE_ID_UTIL_H_
OLDNEW
« no previous file with comments | « components/crx_file/DEPS ('k') | components/crx_file/id_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698