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_prefs.h" | 5 #include "chrome/browser/plugin_prefs.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 force_enable_internal_pdf = true; | 210 force_enable_internal_pdf = true; |
211 } | 211 } |
212 | 212 |
213 { // Scoped update of prefs::kPluginsPluginsList. | 213 { // Scoped update of prefs::kPluginsPluginsList. |
214 ListPrefUpdate update(prefs_, prefs::kPluginsPluginsList); | 214 ListPrefUpdate update(prefs_, prefs::kPluginsPluginsList); |
215 ListValue* saved_plugins_list = update.Get(); | 215 ListValue* saved_plugins_list = update.Get(); |
216 if (saved_plugins_list && !saved_plugins_list->empty()) { | 216 if (saved_plugins_list && !saved_plugins_list->empty()) { |
217 for (ListValue::const_iterator it = saved_plugins_list->begin(); | 217 for (ListValue::const_iterator it = saved_plugins_list->begin(); |
218 it != saved_plugins_list->end(); | 218 it != saved_plugins_list->end(); |
219 ++it) { | 219 ++it) { |
220 if (!(*it)->IsType(Value::TYPE_DICTIONARY)) { | 220 if (!(*it)->IsDictionary()) { |
221 LOG(WARNING) << "Invalid entry in " << prefs::kPluginsPluginsList; | 221 LOG(WARNING) << "Invalid entry in " << prefs::kPluginsPluginsList; |
222 continue; // Oops, don't know what to do with this item. | 222 continue; // Oops, don't know what to do with this item. |
223 } | 223 } |
224 | 224 |
225 DictionaryValue* plugin = static_cast<DictionaryValue*>(*it); | 225 DictionaryValue* plugin = static_cast<DictionaryValue*>(*it); |
226 string16 group_name; | 226 string16 group_name; |
227 bool enabled; | 227 bool enabled; |
228 if (!plugin->GetBoolean("enabled", &enabled)) | 228 if (!plugin->GetBoolean("enabled", &enabled)) |
229 enabled = true; | 229 enabled = true; |
230 | 230 |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
424 prefs->RegisterFilePathPref(prefs::kPluginsLastInternalDirectory, | 424 prefs->RegisterFilePathPref(prefs::kPluginsLastInternalDirectory, |
425 internal_dir, | 425 internal_dir, |
426 PrefService::UNSYNCABLE_PREF); | 426 PrefService::UNSYNCABLE_PREF); |
427 prefs->RegisterListPref(prefs::kPluginsDisabledPlugins, | 427 prefs->RegisterListPref(prefs::kPluginsDisabledPlugins, |
428 PrefService::UNSYNCABLE_PREF); | 428 PrefService::UNSYNCABLE_PREF); |
429 prefs->RegisterListPref(prefs::kPluginsDisabledPluginsExceptions, | 429 prefs->RegisterListPref(prefs::kPluginsDisabledPluginsExceptions, |
430 PrefService::UNSYNCABLE_PREF); | 430 PrefService::UNSYNCABLE_PREF); |
431 prefs->RegisterListPref(prefs::kPluginsEnabledPlugins, | 431 prefs->RegisterListPref(prefs::kPluginsEnabledPlugins, |
432 PrefService::UNSYNCABLE_PREF); | 432 PrefService::UNSYNCABLE_PREF); |
433 } | 433 } |
OLD | NEW |