OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #include "extensions/common/manifest_handlers/shared_module_info.h" | 5 #include "extensions/common/manifest_handlers/shared_module_info.h" |
6 | 6 |
7 #include "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 } | 168 } |
169 imports_.back().extension_id = extension_id; | 169 imports_.back().extension_id = extension_id; |
170 if (import_entry->HasKey(keys::kMinimumVersion)) { | 170 if (import_entry->HasKey(keys::kMinimumVersion)) { |
171 std::string min_version; | 171 std::string min_version; |
172 if (!import_entry->GetString(keys::kMinimumVersion, &min_version)) { | 172 if (!import_entry->GetString(keys::kMinimumVersion, &min_version)) { |
173 *error = ErrorUtils::FormatErrorMessageUTF16( | 173 *error = ErrorUtils::FormatErrorMessageUTF16( |
174 errors::kInvalidImportVersion, base::IntToString(i)); | 174 errors::kInvalidImportVersion, base::IntToString(i)); |
175 return false; | 175 return false; |
176 } | 176 } |
177 imports_.back().minimum_version = min_version; | 177 imports_.back().minimum_version = min_version; |
178 Version v(min_version); | 178 base::Version v(min_version); |
179 if (!v.IsValid()) { | 179 if (!v.IsValid()) { |
180 *error = ErrorUtils::FormatErrorMessageUTF16( | 180 *error = ErrorUtils::FormatErrorMessageUTF16( |
181 errors::kInvalidImportVersion, base::IntToString(i)); | 181 errors::kInvalidImportVersion, base::IntToString(i)); |
182 return false; | 182 return false; |
183 } | 183 } |
184 } | 184 } |
185 } | 185 } |
186 } | 186 } |
187 return true; | 187 return true; |
188 } | 188 } |
(...skipping 30 matching lines...) Expand all Loading... |
219 | 219 |
220 const std::vector<std::string> SharedModuleHandler::Keys() const { | 220 const std::vector<std::string> SharedModuleHandler::Keys() const { |
221 static const char* keys[] = { | 221 static const char* keys[] = { |
222 keys::kExport, | 222 keys::kExport, |
223 keys::kImport | 223 keys::kImport |
224 }; | 224 }; |
225 return std::vector<std::string>(keys, keys + arraysize(keys)); | 225 return std::vector<std::string>(keys, keys + arraysize(keys)); |
226 } | 226 } |
227 | 227 |
228 } // namespace extensions | 228 } // namespace extensions |
OLD | NEW |