| 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_data_remover_helper.h" | 5 #include "chrome/browser/plugin_data_remover_helper.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "chrome/browser/plugin_prefs.h" | 10 #include "chrome/browser/plugin_prefs.h" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 if (type == chrome::NOTIFICATION_PLUGIN_ENABLE_STATUS_CHANGED) { | 51 if (type == chrome::NOTIFICATION_PLUGIN_ENABLE_STATUS_CHANGED) { |
| 52 StartUpdate(); | 52 StartUpdate(); |
| 53 } else { | 53 } else { |
| 54 NOTREACHED(); | 54 NOTREACHED(); |
| 55 } | 55 } |
| 56 } | 56 } |
| 57 | 57 |
| 58 void PluginDataRemoverHelper::StartUpdate() { | 58 void PluginDataRemoverHelper::StartUpdate() { |
| 59 PluginService::GetInstance()->GetPlugins( | 59 PluginService::GetInstance()->GetPlugins( |
| 60 base::Bind(&PluginDataRemoverHelper::GotPlugins, factory_.GetWeakPtr(), | 60 base::Bind(&PluginDataRemoverHelper::GotPlugins, factory_.GetWeakPtr(), |
| 61 make_scoped_refptr(PluginPrefs::GetForProfile(profile_)))); | 61 PluginPrefs::GetForProfile(profile_))); |
| 62 } | 62 } |
| 63 | 63 |
| 64 void PluginDataRemoverHelper::GotPlugins( | 64 void PluginDataRemoverHelper::GotPlugins( |
| 65 scoped_refptr<PluginPrefs> plugin_prefs, | 65 scoped_refptr<PluginPrefs> plugin_prefs, |
| 66 const std::vector<webkit::WebPluginInfo>& plugins) { | 66 const std::vector<webkit::WebPluginInfo>& plugins) { |
| 67 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 67 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 68 bool supported = IsSupported(plugin_prefs); | 68 bool supported = IsSupported(plugin_prefs); |
| 69 // Set the value on the PrefService instead of through the PrefMember to | 69 // Set the value on the PrefService instead of through the PrefMember to |
| 70 // notify observers if it changed. | 70 // notify observers if it changed. |
| 71 profile_->GetPrefs()->SetBoolean(pref_.GetPrefName().c_str(), supported); | 71 profile_->GetPrefs()->SetBoolean(pref_.GetPrefName().c_str(), supported); |
| 72 } | 72 } |
| OLD | NEW |