OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/utility/unpacker.h" | 5 #include "extensions/utility/unpacker.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <set> | 10 #include <set> |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 *error = errors::kInvalidManifest; | 157 *error = errors::kInvalidManifest; |
158 return nullptr; | 158 return nullptr; |
159 } | 159 } |
160 | 160 |
161 JSONFileValueDeserializer deserializer(manifest_path); | 161 JSONFileValueDeserializer deserializer(manifest_path); |
162 std::unique_ptr<base::Value> root = deserializer.Deserialize(NULL, error); | 162 std::unique_ptr<base::Value> root = deserializer.Deserialize(NULL, error); |
163 if (!root.get()) { | 163 if (!root.get()) { |
164 return nullptr; | 164 return nullptr; |
165 } | 165 } |
166 | 166 |
167 if (!root->IsType(base::Value::TYPE_DICTIONARY)) { | 167 if (!root->IsType(base::Value::Type::DICTIONARY)) { |
168 *error = errors::kInvalidManifest; | 168 *error = errors::kInvalidManifest; |
169 return nullptr; | 169 return nullptr; |
170 } | 170 } |
171 | 171 |
172 return base::DictionaryValue::From(std::move(root)); | 172 return base::DictionaryValue::From(std::move(root)); |
173 } | 173 } |
174 | 174 |
175 bool Unpacker::ReadAllMessageCatalogs(const std::string& default_locale) { | 175 bool Unpacker::ReadAllMessageCatalogs(const std::string& default_locale) { |
176 base::FilePath locales_path = extension_dir_.Append(kLocaleFolder); | 176 base::FilePath locales_path = extension_dir_.Append(kLocaleFolder); |
177 | 177 |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 | 325 |
326 void Unpacker::SetError(const std::string& error) { | 326 void Unpacker::SetError(const std::string& error) { |
327 SetUTF16Error(base::UTF8ToUTF16(error)); | 327 SetUTF16Error(base::UTF8ToUTF16(error)); |
328 } | 328 } |
329 | 329 |
330 void Unpacker::SetUTF16Error(const base::string16& error) { | 330 void Unpacker::SetUTF16Error(const base::string16& error) { |
331 error_message_ = error; | 331 error_message_ = error; |
332 } | 332 } |
333 | 333 |
334 } // namespace extensions | 334 } // namespace extensions |
OLD | NEW |