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 1248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1259 // Initialize the URL. | 1259 // Initialize the URL. |
1260 extension_url_ = | 1260 extension_url_ = |
1261 Extension::GetBaseURLFromExtensionId(id()); | 1261 Extension::GetBaseURLFromExtensionId(id()); |
1262 | 1262 |
1263 // Initialize version. | 1263 // Initialize version. |
1264 std::string version_str; | 1264 std::string version_str; |
1265 if (!source.GetString(keys::kVersion, &version_str)) { | 1265 if (!source.GetString(keys::kVersion, &version_str)) { |
1266 *error = errors::kInvalidVersion; | 1266 *error = errors::kInvalidVersion; |
1267 return false; | 1267 return false; |
1268 } | 1268 } |
1269 version_.reset( | 1269 version_.reset(Version::GetVersionFromString(version_str)); |
1270 Version::GetVersionFromString(version_str)); | |
1271 if (!version_.get() || | 1270 if (!version_.get() || |
1272 version_->components().size() > 4) { | 1271 version_->components().size() > 4) { |
1273 *error = errors::kInvalidVersion; | 1272 *error = errors::kInvalidVersion; |
1274 return false; | 1273 return false; |
1275 } | 1274 } |
1276 | 1275 |
1277 // Initialize name. | 1276 // Initialize name. |
1278 string16 localized_name; | 1277 string16 localized_name; |
1279 if (!source.GetString(keys::kName, &localized_name)) { | 1278 if (!source.GetString(keys::kName, &localized_name)) { |
1280 *error = errors::kInvalidName; | 1279 *error = errors::kInvalidName; |
(...skipping 973 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2254 UninstalledExtensionInfo::UninstalledExtensionInfo( | 2253 UninstalledExtensionInfo::UninstalledExtensionInfo( |
2255 const Extension& extension) | 2254 const Extension& extension) |
2256 : extension_id(extension.id()), | 2255 : extension_id(extension.id()), |
2257 extension_api_permissions(extension.api_permissions()), | 2256 extension_api_permissions(extension.api_permissions()), |
2258 is_theme(extension.is_theme()), | 2257 is_theme(extension.is_theme()), |
2259 is_app(extension.is_app()), | 2258 is_app(extension.is_app()), |
2260 converted_from_user_script(extension.converted_from_user_script()), | 2259 converted_from_user_script(extension.converted_from_user_script()), |
2261 update_url(extension.update_url()) {} | 2260 update_url(extension.update_url()) {} |
2262 | 2261 |
2263 UninstalledExtensionInfo::~UninstalledExtensionInfo() {} | 2262 UninstalledExtensionInfo::~UninstalledExtensionInfo() {} |
OLD | NEW |