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" |
11 #include "chrome/browser/prefs/pref_service.h" | 11 #include "chrome/browser/prefs/pref_service.h" |
12 #include "chrome/browser/profiles/profile.h" | 12 #include "chrome/browser/profiles/profile.h" |
13 #include "chrome/common/chrome_notification_types.h" | 13 #include "chrome/common/chrome_notification_types.h" |
14 #include "content/browser/plugin_service.h" | |
15 #include "content/public/browser/browser_thread.h" | 14 #include "content/public/browser/browser_thread.h" |
16 #include "content/public/browser/notification_source.h" | 15 #include "content/public/browser/notification_source.h" |
17 #include "content/public/browser/plugin_data_remover.h" | 16 #include "content/public/browser/plugin_data_remover.h" |
| 17 #include "content/public/browser/plugin_service.h" |
| 18 #include "webkit/plugins/webplugininfo.h" |
18 | 19 |
19 using content::BrowserThread; | 20 using content::BrowserThread; |
| 21 using content::PluginService; |
20 | 22 |
21 PluginDataRemoverHelper::PluginDataRemoverHelper() | 23 PluginDataRemoverHelper::PluginDataRemoverHelper() |
22 : profile_(NULL), | 24 : profile_(NULL), |
23 ALLOW_THIS_IN_INITIALIZER_LIST(factory_(this)) {} | 25 ALLOW_THIS_IN_INITIALIZER_LIST(factory_(this)) {} |
24 | 26 |
25 PluginDataRemoverHelper::~PluginDataRemoverHelper() { | 27 PluginDataRemoverHelper::~PluginDataRemoverHelper() { |
26 } | 28 } |
27 | 29 |
28 void PluginDataRemoverHelper::Init(const char* pref_name, | 30 void PluginDataRemoverHelper::Init(const char* pref_name, |
29 Profile* profile, | 31 Profile* profile, |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 | 63 |
62 void PluginDataRemoverHelper::GotPlugins( | 64 void PluginDataRemoverHelper::GotPlugins( |
63 scoped_refptr<PluginPrefs> plugin_prefs, | 65 scoped_refptr<PluginPrefs> plugin_prefs, |
64 const std::vector<webkit::WebPluginInfo>& plugins) { | 66 const std::vector<webkit::WebPluginInfo>& plugins) { |
65 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 67 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
66 bool supported = IsSupported(plugin_prefs); | 68 bool supported = IsSupported(plugin_prefs); |
67 // 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 |
68 // notify observers if it changed. | 70 // notify observers if it changed. |
69 profile_->GetPrefs()->SetBoolean(pref_.GetPrefName().c_str(), supported); | 71 profile_->GetPrefs()->SetBoolean(pref_.GetPrefName().c_str(), supported); |
70 } | 72 } |
OLD | NEW |