OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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/plugins/plugin_prefs.h" | 5 #include "chrome/browser/plugins/plugin_prefs.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 #include <string> | 10 #include <string> |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 cur_internal_dir != last_internal_dir) { | 122 cur_internal_dir != last_internal_dir) { |
123 update_internal_dir = true; | 123 update_internal_dir = true; |
124 prefs_->SetFilePath( | 124 prefs_->SetFilePath( |
125 prefs::kPluginsLastInternalDirectory, cur_internal_dir); | 125 prefs::kPluginsLastInternalDirectory, cur_internal_dir); |
126 } | 126 } |
127 | 127 |
128 { // Scoped update of prefs::kPluginsPluginsList. | 128 { // Scoped update of prefs::kPluginsPluginsList. |
129 ListPrefUpdate update(prefs_, prefs::kPluginsPluginsList); | 129 ListPrefUpdate update(prefs_, prefs::kPluginsPluginsList); |
130 base::ListValue* saved_plugins_list = update.Get(); | 130 base::ListValue* saved_plugins_list = update.Get(); |
131 if (saved_plugins_list && !saved_plugins_list->empty()) { | 131 if (saved_plugins_list && !saved_plugins_list->empty()) { |
132 for (auto& plugin_value : *saved_plugins_list) { | 132 for (const auto& plugin_value : *saved_plugins_list) { |
133 base::DictionaryValue* plugin; | 133 base::DictionaryValue* plugin; |
134 if (!plugin_value.GetAsDictionary(&plugin)) { | 134 if (!plugin_value->GetAsDictionary(&plugin)) { |
135 LOG(WARNING) << "Invalid entry in " << prefs::kPluginsPluginsList; | 135 LOG(WARNING) << "Invalid entry in " << prefs::kPluginsPluginsList; |
136 continue; // Oops, don't know what to do with this item. | 136 continue; // Oops, don't know what to do with this item. |
137 } | 137 } |
138 | 138 |
139 bool enabled; | 139 bool enabled; |
140 if (!plugin->GetBoolean("enabled", &enabled)) | 140 if (!plugin->GetBoolean("enabled", &enabled)) |
141 enabled = true; | 141 enabled = true; |
142 | 142 |
143 // Migrate disabled plugins and re-enable them all internally. | 143 // Migrate disabled plugins and re-enable them all internally. |
144 // TODO(http://crbug.com/662006): Remove migration eventually. | 144 // TODO(http://crbug.com/662006): Remove migration eventually. |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 } | 282 } |
283 } | 283 } |
284 | 284 |
285 void PluginPrefs::NotifyPluginStatusChanged() { | 285 void PluginPrefs::NotifyPluginStatusChanged() { |
286 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 286 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
287 content::NotificationService::current()->Notify( | 287 content::NotificationService::current()->Notify( |
288 chrome::NOTIFICATION_PLUGIN_ENABLE_STATUS_CHANGED, | 288 chrome::NOTIFICATION_PLUGIN_ENABLE_STATUS_CHANGED, |
289 content::Source<Profile>(profile_), | 289 content::Source<Profile>(profile_), |
290 content::NotificationService::NoDetails()); | 290 content::NotificationService::NoDetails()); |
291 } | 291 } |
OLD | NEW |