Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(678)

Side by Side Diff: chrome/browser/plugins/plugin_status_pref_setter.h

Issue 649683010: Standardize usage of virtual/override/final in chrome/browser/plugins (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_PLUGINS_PLUGIN_STATUS_PREF_SETTER_H_ 5 #ifndef CHROME_BROWSER_PLUGINS_PLUGIN_STATUS_PREF_SETTER_H_
6 #define CHROME_BROWSER_PLUGINS_PLUGIN_STATUS_PREF_SETTER_H_ 6 #define CHROME_BROWSER_PLUGINS_PLUGIN_STATUS_PREF_SETTER_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 10 matching lines...) Expand all
21 struct WebPluginInfo; 21 struct WebPluginInfo;
22 } 22 }
23 23
24 // Helper class modeled after BooleanPrefMember to (asynchronously) update 24 // Helper class modeled after BooleanPrefMember to (asynchronously) update
25 // preferences related to plugin enable status. 25 // preferences related to plugin enable status.
26 // It should only be used from the UI thread. The client has to make sure that 26 // It should only be used from the UI thread. The client has to make sure that
27 // the passed profile outlives this object. 27 // the passed profile outlives this object.
28 class PluginStatusPrefSetter : public content::NotificationObserver { 28 class PluginStatusPrefSetter : public content::NotificationObserver {
29 public: 29 public:
30 PluginStatusPrefSetter(); 30 PluginStatusPrefSetter();
31 virtual ~PluginStatusPrefSetter(); 31 ~PluginStatusPrefSetter() override;
32 32
33 // Binds the preferences in the profile's PrefService, notifying |observer| if 33 // Binds the preferences in the profile's PrefService, notifying |observer| if
34 // any value changes. 34 // any value changes.
35 // This asynchronously calls the PluginService to get the list of installed 35 // This asynchronously calls the PluginService to get the list of installed
36 // plug-ins. 36 // plug-ins.
37 void Init(Profile* profile, 37 void Init(Profile* profile,
38 const BooleanPrefMember::NamedChangeCallback& observer); 38 const BooleanPrefMember::NamedChangeCallback& observer);
39 39
40 bool IsClearPluginLSODataEnabled() const { 40 bool IsClearPluginLSODataEnabled() const {
41 return clear_plugin_lso_data_enabled_.GetValue(); 41 return clear_plugin_lso_data_enabled_.GetValue();
42 } 42 }
43 43
44 bool IsPepperFlashSettingsEnabled() const { 44 bool IsPepperFlashSettingsEnabled() const {
45 return pepper_flash_settings_enabled_.GetValue(); 45 return pepper_flash_settings_enabled_.GetValue();
46 } 46 }
47 47
48 // content::NotificationObserver methods: 48 // content::NotificationObserver methods:
49 virtual void Observe(int type, 49 void Observe(int type,
50 const content::NotificationSource& source, 50 const content::NotificationSource& source,
51 const content::NotificationDetails& details) override; 51 const content::NotificationDetails& details) override;
52 52
53 private: 53 private:
54 void StartUpdate(); 54 void StartUpdate();
55 void GotPlugins(scoped_refptr<PluginPrefs> plugin_prefs, 55 void GotPlugins(scoped_refptr<PluginPrefs> plugin_prefs,
56 const std::vector<content::WebPluginInfo>& plugins); 56 const std::vector<content::WebPluginInfo>& plugins);
57 57
58 content::NotificationRegistrar registrar_; 58 content::NotificationRegistrar registrar_;
59 // Weak pointer. 59 // Weak pointer.
60 Profile* profile_; 60 Profile* profile_;
61 61
62 // Whether clearing LSO data is supported. 62 // Whether clearing LSO data is supported.
63 BooleanPrefMember clear_plugin_lso_data_enabled_; 63 BooleanPrefMember clear_plugin_lso_data_enabled_;
64 // Whether we should show Pepper Flash-specific settings. 64 // Whether we should show Pepper Flash-specific settings.
65 BooleanPrefMember pepper_flash_settings_enabled_; 65 BooleanPrefMember pepper_flash_settings_enabled_;
66 66
67 base::WeakPtrFactory<PluginStatusPrefSetter> factory_; 67 base::WeakPtrFactory<PluginStatusPrefSetter> factory_;
68 68
69 DISALLOW_COPY_AND_ASSIGN(PluginStatusPrefSetter); 69 DISALLOW_COPY_AND_ASSIGN(PluginStatusPrefSetter);
70 }; 70 };
71 71
72 #endif // CHROME_BROWSER_PLUGINS_PLUGIN_STATUS_PREF_SETTER_H_ 72 #endif // CHROME_BROWSER_PLUGINS_PLUGIN_STATUS_PREF_SETTER_H_
OLDNEW
« no previous file with comments | « chrome/browser/plugins/plugin_prefs_factory.h ('k') | chrome/browser/plugins/plugins_resource_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698