OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #include "chrome/browser/extensions/external_extension_util.h" | |
6 | |
7 #include "base/bind.h" | |
8 #include "base/file_path.h" | |
9 #include "base/file_util.h" | |
10 #include "base/json/json_file_value_serializer.h" | |
11 #include "base/json/json_string_value_serializer.h" | |
12 #include "base/string_util.h" | |
13 #include "base/utf_string_conversions.h" | |
14 #include "base/values.h" | |
15 #include "base/version.h" | |
16 | |
17 DictionaryValue* ExternalExtensionUtil::ExtractExtensionPrefs( | |
18 const FilePath& path, | |
19 base::ValueSerializer* serializer) { | |
20 std::string error_msg; | |
21 Value* extensions = serializer->Deserialize(NULL, &error_msg); | |
22 if (!extensions) { | |
23 LOG(WARNING) << "Unable to deserialize json data: " << error_msg | |
24 << " In file " << path.value() << " ."; | |
Finnur
2012/04/25 13:33:45
There is still a whitespace before period in the l
Alexandre Abreu
2012/04/25 15:31:05
Done.
| |
25 return new DictionaryValue; | |
26 } | |
27 | |
28 DictionaryValue * ext_dictionary = NULL; | |
Finnur
2012/04/25 13:33:45
DictionaryValue*
not
DictionaryValue *
Alexandre Abreu
2012/04/25 15:31:05
Done.
| |
29 if (extensions->GetAsDictionary(&ext_dictionary)) { | |
30 return ext_dictionary; | |
31 } | |
Finnur
2012/04/25 13:33:45
nit: We don't use braces if the |if| clause (or th
Alexandre Abreu
2012/04/25 15:31:05
Done.
| |
32 | |
33 LOG(WARNING) << "Expected a JSON dictionary in file " | |
34 << path.value() << " ."; | |
Finnur
2012/04/25 13:33:45
Same here (remove space before period).
Alexandre Abreu
2012/04/25 15:31:05
Done.
| |
35 return new DictionaryValue; | |
36 } | |
37 | |
OLD | NEW |