Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(422)

Side by Side Diff: chrome/browser/extensions/external_extension_util.cc

Issue 9963120: Introduces an additional extension loader that load extra extensions based on per-extension json fi… (Closed) Base URL: https://src.chromium.org/svn/trunk/src/
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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
18 // Caller takes ownership of the returned dictionary.
Sam Kerner (Chrome) 2012/04/13 22:11:02 Now that this is in its own file, a comment explai
Alexandre Abreu 2012/04/13 23:24:46 Done.
19 DictionaryValue* ExternalExtensionUtil::ExtractPrefs(
20 const FilePath& path,
21 base::ValueSerializer* serializer) {
22 std::string error_msg;
23 Value* extensions = serializer->Deserialize(NULL, &error_msg);
24 if (!extensions) {
25 LOG(WARNING) << "Unable to deserialize json data: " << error_msg
26 << " In file " << path.value() << " .";
27 } else {
28 if (!extensions->IsType(Value::TYPE_DICTIONARY)) {
29 LOG(WARNING) << "Expected a JSON dictionary in file "
30 << path.value() << " .";
31 } else {
32 return static_cast<DictionaryValue*>(extensions);
33 }
34 }
35 return new DictionaryValue;
36 }
37
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698