OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/plugin_updater.h" | 5 #include "chrome/browser/plugin_updater.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 force_enable_internal_pdf = true; | 155 force_enable_internal_pdf = true; |
156 } | 156 } |
157 | 157 |
158 { // Scoped update of prefs::kPluginsPluginsList. | 158 { // Scoped update of prefs::kPluginsPluginsList. |
159 ListPrefUpdate update(profile->GetPrefs(), prefs::kPluginsPluginsList); | 159 ListPrefUpdate update(profile->GetPrefs(), prefs::kPluginsPluginsList); |
160 ListValue* saved_plugins_list = update.Get(); | 160 ListValue* saved_plugins_list = update.Get(); |
161 if (saved_plugins_list && !saved_plugins_list->empty()) { | 161 if (saved_plugins_list && !saved_plugins_list->empty()) { |
162 for (ListValue::const_iterator it = saved_plugins_list->begin(); | 162 for (ListValue::const_iterator it = saved_plugins_list->begin(); |
163 it != saved_plugins_list->end(); | 163 it != saved_plugins_list->end(); |
164 ++it) { | 164 ++it) { |
165 if (!(*it)->IsType(Value::TYPE_DICTIONARY)) { | 165 if (!(*it)->IsDictionary()) { |
166 LOG(WARNING) << "Invalid entry in " << prefs::kPluginsPluginsList; | 166 LOG(WARNING) << "Invalid entry in " << prefs::kPluginsPluginsList; |
167 continue; // Oops, don't know what to do with this item. | 167 continue; // Oops, don't know what to do with this item. |
168 } | 168 } |
169 | 169 |
170 DictionaryValue* plugin = static_cast<DictionaryValue*>(*it); | 170 DictionaryValue* plugin = static_cast<DictionaryValue*>(*it); |
171 string16 group_name; | 171 string16 group_name; |
172 bool enabled; | 172 bool enabled; |
173 if (!plugin->GetBoolean("enabled", &enabled)) | 173 if (!plugin->GetBoolean("enabled", &enabled)) |
174 enabled = true; | 174 enabled = true; |
175 | 175 |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
346 prefs->RegisterFilePathPref(prefs::kPluginsLastInternalDirectory, | 346 prefs->RegisterFilePathPref(prefs::kPluginsLastInternalDirectory, |
347 internal_dir, | 347 internal_dir, |
348 PrefService::UNSYNCABLE_PREF); | 348 PrefService::UNSYNCABLE_PREF); |
349 prefs->RegisterListPref(prefs::kPluginsDisabledPlugins, | 349 prefs->RegisterListPref(prefs::kPluginsDisabledPlugins, |
350 PrefService::UNSYNCABLE_PREF); | 350 PrefService::UNSYNCABLE_PREF); |
351 prefs->RegisterListPref(prefs::kPluginsDisabledPluginsExceptions, | 351 prefs->RegisterListPref(prefs::kPluginsDisabledPluginsExceptions, |
352 PrefService::UNSYNCABLE_PREF); | 352 PrefService::UNSYNCABLE_PREF); |
353 prefs->RegisterListPref(prefs::kPluginsEnabledPlugins, | 353 prefs->RegisterListPref(prefs::kPluginsEnabledPlugins, |
354 PrefService::UNSYNCABLE_PREF); | 354 PrefService::UNSYNCABLE_PREF); |
355 } | 355 } |
OLD | NEW |