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

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

Issue 3077022: Extension package creation cleanup (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Now with proper threading Created 10 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
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 #include "chrome/common/extensions/extension.h" 5 #include "chrome/common/extensions/extension.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "app/l10n_util.h" 9 #include "app/l10n_util.h"
10 #include "base/base64.h" 10 #include "base/base64.h"
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 160
161 Extension::~Extension() { 161 Extension::~Extension() {
162 } 162 }
163 163
164 const std::string Extension::VersionString() const { 164 const std::string Extension::VersionString() const {
165 return version_->GetString(); 165 return version_->GetString();
166 } 166 }
167 167
168 // static 168 // static
169 bool Extension::IsExtension(const FilePath& file_name) { 169 bool Extension::IsExtension(const FilePath& file_name) {
170 return file_name.MatchesExtension( 170 return file_name.MatchesExtension(chrome::kExtensionFileExtension);
171 FilePath::StringType(FILE_PATH_LITERAL(".")) +
172 chrome::kExtensionFileExtension);
173 } 171 }
174 172
175 // static 173 // static
176 bool Extension::IdIsValid(const std::string& id) { 174 bool Extension::IdIsValid(const std::string& id) {
177 // Verify that the id is legal. 175 // Verify that the id is legal.
178 if (id.size() != (kIdSize * 2)) 176 if (id.size() != (kIdSize * 2))
179 return false; 177 return false;
180 178
181 // We only support lowercase IDs, because IDs can be used as URL components 179 // We only support lowercase IDs, because IDs can be used as URL components
182 // (where GURL will lowercase it). 180 // (where GURL will lowercase it).
(...skipping 1561 matching lines...) Expand 10 before | Expand all | Expand 10 after
1744 } else { 1742 } else {
1745 return false; 1743 return false;
1746 } 1744 }
1747 } else { 1745 } else {
1748 return true; 1746 return true;
1749 } 1747 }
1750 } 1748 }
1751 } 1749 }
1752 return false; 1750 return false;
1753 } 1751 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698