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