| OLD | NEW |
| 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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 | 161 |
| 162 Extension::~Extension() { | 162 Extension::~Extension() { |
| 163 } | 163 } |
| 164 | 164 |
| 165 const std::string Extension::VersionString() const { | 165 const std::string Extension::VersionString() const { |
| 166 return version_->GetString(); | 166 return version_->GetString(); |
| 167 } | 167 } |
| 168 | 168 |
| 169 // static | 169 // static |
| 170 bool Extension::IsExtension(const FilePath& file_name) { | 170 bool Extension::IsExtension(const FilePath& file_name) { |
| 171 return file_name.MatchesExtension( | 171 return file_name.MatchesExtension(chrome::kExtensionFileExtension); |
| 172 FilePath::StringType(FILE_PATH_LITERAL(".")) + | |
| 173 chrome::kExtensionFileExtension); | |
| 174 } | 172 } |
| 175 | 173 |
| 176 // static | 174 // static |
| 177 bool Extension::IdIsValid(const std::string& id) { | 175 bool Extension::IdIsValid(const std::string& id) { |
| 178 // Verify that the id is legal. | 176 // Verify that the id is legal. |
| 179 if (id.size() != (kIdSize * 2)) | 177 if (id.size() != (kIdSize * 2)) |
| 180 return false; | 178 return false; |
| 181 | 179 |
| 182 // We only support lowercase IDs, because IDs can be used as URL components | 180 // We only support lowercase IDs, because IDs can be used as URL components |
| 183 // (where GURL will lowercase it). | 181 // (where GURL will lowercase it). |
| (...skipping 1575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1759 } else { | 1757 } else { |
| 1760 return false; | 1758 return false; |
| 1761 } | 1759 } |
| 1762 } else { | 1760 } else { |
| 1763 return true; | 1761 return true; |
| 1764 } | 1762 } |
| 1765 } | 1763 } |
| 1766 } | 1764 } |
| 1767 return false; | 1765 return false; |
| 1768 } | 1766 } |
| OLD | NEW |