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_split.h" | 10 #include "base/strings/string_split.h" |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 } | 176 } |
177 imports_.back().extension_id = extension_id; | 177 imports_.back().extension_id = extension_id; |
178 if (import_entry->HasKey(keys::kMinimumVersion)) { | 178 if (import_entry->HasKey(keys::kMinimumVersion)) { |
179 std::string min_version; | 179 std::string min_version; |
180 if (!import_entry->GetString(keys::kMinimumVersion, &min_version)) { | 180 if (!import_entry->GetString(keys::kMinimumVersion, &min_version)) { |
181 *error = ErrorUtils::FormatErrorMessageUTF16( | 181 *error = ErrorUtils::FormatErrorMessageUTF16( |
182 errors::kInvalidImportVersion, base::IntToString(i)); | 182 errors::kInvalidImportVersion, base::IntToString(i)); |
183 return false; | 183 return false; |
184 } | 184 } |
185 imports_.back().minimum_version = min_version; | 185 imports_.back().minimum_version = min_version; |
186 base::Version v(min_version); | 186 Version v(min_version); |
187 if (!v.IsValid()) { | 187 if (!v.IsValid()) { |
188 *error = ErrorUtils::FormatErrorMessageUTF16( | 188 *error = ErrorUtils::FormatErrorMessageUTF16( |
189 errors::kInvalidImportVersion, base::IntToString(i)); | 189 errors::kInvalidImportVersion, base::IntToString(i)); |
190 return false; | 190 return false; |
191 } | 191 } |
192 } | 192 } |
193 } | 193 } |
194 } | 194 } |
195 return true; | 195 return true; |
196 } | 196 } |
(...skipping 30 matching lines...) Expand all Loading... |
227 | 227 |
228 const std::vector<std::string> SharedModuleHandler::Keys() const { | 228 const std::vector<std::string> SharedModuleHandler::Keys() const { |
229 static const char* keys[] = { | 229 static const char* keys[] = { |
230 keys::kExport, | 230 keys::kExport, |
231 keys::kImport | 231 keys::kImport |
232 }; | 232 }; |
233 return std::vector<std::string>(keys, keys + arraysize(keys)); | 233 return std::vector<std::string>(keys, keys + arraysize(keys)); |
234 } | 234 } |
235 | 235 |
236 } // namespace extensions | 236 } // namespace extensions |
OLD | NEW |