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

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

Issue 441008: Many changes to DictionaryValues:... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 "chrome/browser/extensions/external_pref_extension_provider.h" 5 #include "chrome/browser/extensions/external_pref_extension_provider.h"
6 6
7 #include "app/app_paths.h" 7 #include "app/app_paths.h"
8 #include "base/file_path.h" 8 #include "base/file_path.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 26 matching lines...) Expand all
37 } 37 }
38 38
39 void ExternalPrefExtensionProvider::VisitRegisteredExtension( 39 void ExternalPrefExtensionProvider::VisitRegisteredExtension(
40 Visitor* visitor, const std::set<std::string>& ids_to_ignore) const { 40 Visitor* visitor, const std::set<std::string>& ids_to_ignore) const {
41 for (DictionaryValue::key_iterator i = prefs_->begin_keys(); 41 for (DictionaryValue::key_iterator i = prefs_->begin_keys();
42 i != prefs_->end_keys(); ++i) { 42 i != prefs_->end_keys(); ++i) {
43 const std::wstring& extension_id = *i; 43 const std::wstring& extension_id = *i;
44 if (ids_to_ignore.find(WideToASCII(extension_id)) != ids_to_ignore.end()) 44 if (ids_to_ignore.find(WideToASCII(extension_id)) != ids_to_ignore.end())
45 continue; 45 continue;
46 46
47 DictionaryValue* extension = NULL; 47 DictionaryValue* extension;
48 if (!prefs_->GetDictionary(extension_id, &extension)) { 48 if (!prefs_->GetDictionaryWithoutPathExpansion(extension_id, &extension))
49 continue; 49 continue;
50 }
51 50
52 FilePath::StringType external_crx; 51 FilePath::StringType external_crx;
53 std::string external_version; 52 std::string external_version;
54 if (!extension->GetString(kExternalCrx, &external_crx) || 53 if (!extension->GetString(kExternalCrx, &external_crx) ||
55 !extension->GetString(kExternalVersion, &external_version)) { 54 !extension->GetString(kExternalVersion, &external_version)) {
56 LOG(WARNING) << "Malformed extension dictionary for extension: " 55 LOG(WARNING) << "Malformed extension dictionary for extension: "
57 << extension_id.c_str(); 56 << extension_id.c_str();
58 continue; 57 continue;
59 } 58 }
60 59
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 if (extensions) { 108 if (extensions) {
110 if (!extensions->IsType(Value::TYPE_DICTIONARY)) { 109 if (!extensions->IsType(Value::TYPE_DICTIONARY)) {
111 NOTREACHED() << L"Invalid json data"; 110 NOTREACHED() << L"Invalid json data";
112 } else { 111 } else {
113 dictionary.reset(static_cast<DictionaryValue*>(extensions)); 112 dictionary.reset(static_cast<DictionaryValue*>(extensions));
114 } 113 }
115 } 114 }
116 } 115 }
117 prefs_.reset(dictionary.release()); 116 prefs_.reset(dictionary.release());
118 } 117 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698