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 #ifndef CHROME_BROWSER_PLUGIN_DATA_REMOVER_HELPER_H_ | 5 #ifndef CHROME_BROWSER_PLUGIN_DATA_REMOVER_HELPER_H_ |
6 #define CHROME_BROWSER_PLUGIN_DATA_REMOVER_HELPER_H_ | 6 #define CHROME_BROWSER_PLUGIN_DATA_REMOVER_HELPER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 23 matching lines...) Expand all Loading... |
34 // Binds this object to the |pref_name| preference in the profile's | 34 // Binds this object to the |pref_name| preference in the profile's |
35 // PrefService, notifying |observer| if the value changes. | 35 // PrefService, notifying |observer| if the value changes. |
36 // This asynchronously calls the PluginService to get the list of installed | 36 // This asynchronously calls the PluginService to get the list of installed |
37 // plug-ins. | 37 // plug-ins. |
38 void Init(const char* pref_name, | 38 void Init(const char* pref_name, |
39 Profile* profile, | 39 Profile* profile, |
40 content::NotificationObserver* observer); | 40 content::NotificationObserver* observer); |
41 | 41 |
42 bool GetValue() const { return pref_.GetValue(); } | 42 bool GetValue() const { return pref_.GetValue(); } |
43 | 43 |
| 44 // Like PluginDataRemover::IsSupported, but checks that the returned plugin |
| 45 // is enabled by PluginPrefs |
| 46 static bool IsSupported(PluginPrefs* plugin_prefs); |
| 47 |
44 // content::NotificationObserver methods: | 48 // content::NotificationObserver methods: |
45 virtual void Observe(int type, | 49 virtual void Observe(int type, |
46 const content::NotificationSource& source, | 50 const content::NotificationSource& source, |
47 const content::NotificationDetails& details); | 51 const content::NotificationDetails& details); |
48 | 52 |
49 private: | 53 private: |
50 void StartUpdate(); | 54 void StartUpdate(); |
51 void GotPlugins(scoped_refptr<PluginPrefs> plugin_prefs, | 55 void GotPlugins(scoped_refptr<PluginPrefs> plugin_prefs, |
52 const std::vector<webkit::WebPluginInfo>& plugins); | 56 const std::vector<webkit::WebPluginInfo>& plugins); |
53 | 57 |
54 BooleanPrefMember pref_; | 58 BooleanPrefMember pref_; |
55 content::NotificationRegistrar registrar_; | 59 content::NotificationRegistrar registrar_; |
56 // Weak pointer. | 60 // Weak pointer. |
57 Profile* profile_; | 61 Profile* profile_; |
58 base::WeakPtrFactory<PluginDataRemoverHelper> factory_; | 62 base::WeakPtrFactory<PluginDataRemoverHelper> factory_; |
59 | 63 |
60 DISALLOW_COPY_AND_ASSIGN(PluginDataRemoverHelper); | 64 DISALLOW_COPY_AND_ASSIGN(PluginDataRemoverHelper); |
61 }; | 65 }; |
62 | 66 |
63 #endif // CHROME_BROWSER_PLUGIN_DATA_REMOVER_HELPER_H_ | 67 #endif // CHROME_BROWSER_PLUGIN_DATA_REMOVER_HELPER_H_ |
OLD | NEW |