| 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_data_remover.h" | 10 #include "chrome/browser/plugin_data_remover.h" |
| 11 #include "chrome/browser/plugin_prefs.h" | 11 #include "chrome/browser/plugin_prefs.h" |
| 12 #include "chrome/browser/prefs/pref_service.h" | 12 #include "chrome/browser/prefs/pref_service.h" |
| 13 #include "chrome/browser/profiles/profile.h" | 13 #include "chrome/browser/profiles/profile.h" |
| 14 #include "chrome/common/chrome_notification_types.h" | 14 #include "chrome/common/chrome_notification_types.h" |
| 15 #include "content/browser/browser_thread.h" | 15 #include "content/browser/browser_thread.h" |
| 16 #include "content/browser/plugin_service.h" | 16 #include "content/browser/plugin_service.h" |
| 17 #include "content/common/notification_service.h" | 17 #include "content/public/browser/notification_source.h" |
| 18 | 18 |
| 19 PluginDataRemoverHelper::PluginDataRemoverHelper() | 19 PluginDataRemoverHelper::PluginDataRemoverHelper() |
| 20 : profile_(NULL), | 20 : profile_(NULL), |
| 21 ALLOW_THIS_IN_INITIALIZER_LIST(factory_(this)) {} | 21 ALLOW_THIS_IN_INITIALIZER_LIST(factory_(this)) {} |
| 22 | 22 |
| 23 PluginDataRemoverHelper::~PluginDataRemoverHelper() { | 23 PluginDataRemoverHelper::~PluginDataRemoverHelper() { |
| 24 } | 24 } |
| 25 | 25 |
| 26 void PluginDataRemoverHelper::Init(const char* pref_name, | 26 void PluginDataRemoverHelper::Init(const char* pref_name, |
| 27 Profile* profile, | 27 Profile* profile, |
| (...skipping 24 matching lines...) Expand all Loading... |
| 52 | 52 |
| 53 void PluginDataRemoverHelper::GotPlugins( | 53 void PluginDataRemoverHelper::GotPlugins( |
| 54 scoped_refptr<PluginPrefs> plugin_prefs, | 54 scoped_refptr<PluginPrefs> plugin_prefs, |
| 55 const std::vector<webkit::WebPluginInfo>& plugins) { | 55 const std::vector<webkit::WebPluginInfo>& plugins) { |
| 56 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 56 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 57 bool supported = PluginDataRemover::IsSupported(plugin_prefs); | 57 bool supported = PluginDataRemover::IsSupported(plugin_prefs); |
| 58 // Set the value on the PrefService instead of through the PrefMember to | 58 // Set the value on the PrefService instead of through the PrefMember to |
| 59 // notify observers if it changed. | 59 // notify observers if it changed. |
| 60 profile_->GetPrefs()->SetBoolean(pref_.GetPrefName().c_str(), supported); | 60 profile_->GetPrefs()->SetBoolean(pref_.GetPrefName().c_str(), supported); |
| 61 } | 61 } |
| OLD | NEW |