| Index: chrome/browser/plugin_status_pref_setter.h
|
| diff --git a/chrome/browser/plugin_data_remover_helper.h b/chrome/browser/plugin_status_pref_setter.h
|
| similarity index 54%
|
| copy from chrome/browser/plugin_data_remover_helper.h
|
| copy to chrome/browser/plugin_status_pref_setter.h
|
| index 938b17c9dd153e14017572d6cb360814a34dbbda..8667f3ff940eb8f0694ec37e6aeff6b239d1d642 100644
|
| --- a/chrome/browser/plugin_data_remover_helper.h
|
| +++ b/chrome/browser/plugin_status_pref_setter.h
|
| @@ -1,9 +1,9 @@
|
| -// Copyright (c) 2011 The Chromium Authors. All rights reserved.
|
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved.
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#ifndef CHROME_BROWSER_PLUGIN_DATA_REMOVER_HELPER_H_
|
| -#define CHROME_BROWSER_PLUGIN_DATA_REMOVER_HELPER_H_
|
| +#ifndef CHROME_BROWSER_PLUGIN_STATUS_PREF_SETTER_H_
|
| +#define CHROME_BROWSER_PLUGIN_STATUS_PREF_SETTER_H_
|
| #pragma once
|
|
|
| #include <vector>
|
| @@ -15,6 +15,7 @@
|
| #include "content/public/browser/notification_registrar.h"
|
|
|
| class PluginPrefs;
|
| +class PrefService;
|
| class Profile;
|
|
|
| namespace webkit {
|
| @@ -22,28 +23,28 @@ struct WebPluginInfo;
|
| }
|
|
|
| // Helper class modeled after BooleanPrefMember to (asynchronously) update
|
| -// the preference specifying whether clearing plug-in data is supported
|
| -// by an installed plug-in.
|
| +// preferences related to plugin enable status.
|
| // It should only be used from the UI thread. The client has to make sure that
|
| // the passed profile outlives this object.
|
| -class PluginDataRemoverHelper : public content::NotificationObserver {
|
| +class PluginStatusPrefSetter : public content::NotificationObserver {
|
| public:
|
| - PluginDataRemoverHelper();
|
| - virtual ~PluginDataRemoverHelper();
|
| + PluginStatusPrefSetter();
|
| + virtual ~PluginStatusPrefSetter();
|
|
|
| - // Binds this object to the |pref_name| preference in the profile's
|
| - // PrefService, notifying |observer| if the value changes.
|
| + // Binds the preferences in the profile's PrefService, notifying |observer| if
|
| + // any value changes.
|
| // This asynchronously calls the PluginService to get the list of installed
|
| // plug-ins.
|
| - void Init(const char* pref_name,
|
| - Profile* profile,
|
| + void Init(Profile* profile,
|
| content::NotificationObserver* observer);
|
|
|
| - bool GetValue() const { return pref_.GetValue(); }
|
| + bool IsClearPluginLSODataEnabled() const {
|
| + return clear_plugin_lso_data_enabled_.GetValue();
|
| + }
|
|
|
| - // Like PluginDataRemover::IsSupported, but checks that the returned plugin
|
| - // is enabled by PluginPrefs
|
| - static bool IsSupported(PluginPrefs* plugin_prefs);
|
| + bool IsPepperFlashSettingsEnabled() const {
|
| + return pepper_flash_settings_enabled_.GetValue();
|
| + }
|
|
|
| // content::NotificationObserver methods:
|
| virtual void Observe(int type,
|
| @@ -55,13 +56,17 @@ class PluginDataRemoverHelper : public content::NotificationObserver {
|
| void GotPlugins(scoped_refptr<PluginPrefs> plugin_prefs,
|
| const std::vector<webkit::WebPluginInfo>& plugins);
|
|
|
| - BooleanPrefMember pref_;
|
| content::NotificationRegistrar registrar_;
|
| // Weak pointer.
|
| Profile* profile_;
|
| - base::WeakPtrFactory<PluginDataRemoverHelper> factory_;
|
| + base::WeakPtrFactory<PluginStatusPrefSetter> factory_;
|
|
|
| - DISALLOW_COPY_AND_ASSIGN(PluginDataRemoverHelper);
|
| + // Whether clearing LSO data is supported.
|
| + BooleanPrefMember clear_plugin_lso_data_enabled_;
|
| + // Whether we should show Pepper Flash-specific settings.
|
| + BooleanPrefMember pepper_flash_settings_enabled_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(PluginStatusPrefSetter);
|
| };
|
|
|
| -#endif // CHROME_BROWSER_PLUGIN_DATA_REMOVER_HELPER_H_
|
| +#endif // CHROME_BROWSER_PLUGIN_STATUS_PREF_SETTER_H_
|
|
|