OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 | 266 |
267 // Add the plugin files. | 267 // Add the plugin files. |
268 for (std::vector<WebPluginInfo>::const_iterator it = plugins.begin(); | 268 for (std::vector<WebPluginInfo>::const_iterator it = plugins.begin(); |
269 it != plugins.end(); | 269 it != plugins.end(); |
270 ++it) { | 270 ++it) { |
271 plugins_list->Append(CreatePluginFileSummary(*it)); | 271 plugins_list->Append(CreatePluginFileSummary(*it)); |
272 } | 272 } |
273 | 273 |
274 // Add the groups as well. | 274 // Add the groups as well. |
275 for (size_t i = 0; i < groups.size(); ++i) { | 275 for (size_t i = 0; i < groups.size(); ++i) { |
276 // Don't save preferences for vulnerable pugins. | 276 plugins_list->Append(groups[i].GetSummary()); |
277 if (!CommandLine::ForCurrentProcess()->HasSwitch( | |
278 switches::kDisableOutdatedPlugins) || | |
279 !groups[i].IsVulnerable()) { | |
280 plugins_list->Append(groups[i].GetSummary()); | |
281 } | |
282 } | 277 } |
283 } | 278 } |
284 | 279 |
285 void PluginUpdater::NotifyPluginStatusChanged() { | 280 void PluginUpdater::NotifyPluginStatusChanged() { |
286 if (notify_pending_) | 281 if (notify_pending_) |
287 return; | 282 return; |
288 notify_pending_ = true; | 283 notify_pending_ = true; |
289 MessageLoop::current()->PostTask( | 284 MessageLoop::current()->PostTask( |
290 FROM_HERE, | 285 FROM_HERE, |
291 NewRunnableFunction(&PluginUpdater::OnNotifyPluginStatusChanged)); | 286 NewRunnableFunction(&PluginUpdater::OnNotifyPluginStatusChanged)); |
292 } | 287 } |
293 | 288 |
294 void PluginUpdater::OnNotifyPluginStatusChanged() { | 289 void PluginUpdater::OnNotifyPluginStatusChanged() { |
295 GetInstance()->notify_pending_ = false; | 290 GetInstance()->notify_pending_ = false; |
296 NotificationService::current()->Notify( | 291 NotificationService::current()->Notify( |
297 NotificationType::PLUGIN_ENABLE_STATUS_CHANGED, | 292 NotificationType::PLUGIN_ENABLE_STATUS_CHANGED, |
298 Source<PluginUpdater>(GetInstance()), | 293 Source<PluginUpdater>(GetInstance()), |
299 NotificationService::NoDetails()); | 294 NotificationService::NoDetails()); |
300 } | 295 } |
301 | 296 |
302 /*static*/ | 297 /*static*/ |
303 PluginUpdater* PluginUpdater::GetInstance() { | 298 PluginUpdater* PluginUpdater::GetInstance() { |
304 return Singleton<PluginUpdater>::get(); | 299 return Singleton<PluginUpdater>::get(); |
305 } | 300 } |
OLD | NEW |