1. Token CRCs are not handled correctly. This adds the corrected Whispernet binary...
[chromium-blink-merge.git] / chrome / browser / plugins / plugin_status_pref_setter.h
blobee7c9759396e4ef37fec876f89a60be1a4082422
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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_PLUGINS_PLUGIN_STATUS_PREF_SETTER_H_
6 #define CHROME_BROWSER_PLUGINS_PLUGIN_STATUS_PREF_SETTER_H_
8 #include <vector>
10 #include "base/memory/ref_counted.h"
11 #include "base/memory/weak_ptr.h"
12 #include "base/prefs/pref_member.h"
13 #include "content/public/browser/notification_observer.h"
14 #include "content/public/browser/notification_registrar.h"
16 class PluginPrefs;
17 class PrefService;
18 class Profile;
20 namespace content {
21 struct WebPluginInfo;
24 // Helper class modeled after BooleanPrefMember to (asynchronously) update
25 // preferences related to plugin enable status.
26 // It should only be used from the UI thread. The client has to make sure that
27 // the passed profile outlives this object.
28 class PluginStatusPrefSetter : public content::NotificationObserver {
29 public:
30 PluginStatusPrefSetter();
31 ~PluginStatusPrefSetter() override;
33 // Binds the preferences in the profile's PrefService, notifying |observer| if
34 // any value changes.
35 // This asynchronously calls the PluginService to get the list of installed
36 // plug-ins.
37 void Init(Profile* profile,
38 const BooleanPrefMember::NamedChangeCallback& observer);
40 bool IsClearPluginLSODataEnabled() const {
41 return clear_plugin_lso_data_enabled_.GetValue();
44 bool IsPepperFlashSettingsEnabled() const {
45 return pepper_flash_settings_enabled_.GetValue();
48 // content::NotificationObserver methods:
49 void Observe(int type,
50 const content::NotificationSource& source,
51 const content::NotificationDetails& details) override;
53 private:
54 void StartUpdate();
55 void GotPlugins(scoped_refptr<PluginPrefs> plugin_prefs,
56 const std::vector<content::WebPluginInfo>& plugins);
58 content::NotificationRegistrar registrar_;
59 // Weak pointer.
60 Profile* profile_;
62 // Whether clearing LSO data is supported.
63 BooleanPrefMember clear_plugin_lso_data_enabled_;
64 // Whether we should show Pepper Flash-specific settings.
65 BooleanPrefMember pepper_flash_settings_enabled_;
67 base::WeakPtrFactory<PluginStatusPrefSetter> factory_;
69 DISALLOW_COPY_AND_ASSIGN(PluginStatusPrefSetter);
72 #endif // CHROME_BROWSER_PLUGINS_PLUGIN_STATUS_PREF_SETTER_H_