| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_CONTENT_SETTINGS_H_ | 5 #ifndef COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_CONTENT_SETTINGS_H_ |
| 6 #define COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_CONTENT_SETTINGS_H_ | 6 #define COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_CONTENT_SETTINGS_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "components/content_settings/core/common/content_settings.h" | 9 #include "components/content_settings/core/common/content_settings.h" |
| 10 #include "components/content_settings/core/common/content_settings_types.h" | 10 #include "components/content_settings/core/common/content_settings_types.h" |
| 11 | 11 |
| 12 namespace content_settings { | 12 namespace content_settings { |
| 13 | 13 |
| 14 // This class manages the Plugins field trials. | 14 // This class manages the Plugins field trials. |
| 15 class PluginsFieldTrial { | 15 class PluginsFieldTrial { |
| 16 public: | 16 public: |
| 17 static const char kFieldTrialName[]; | 17 // A legacy field trial used to dogfood Plugin Power Saver. Remove soon. |
| 18 static const char kForceFieldTrial[]; |
| 19 |
| 20 // The field trial responsible for rolling out Plugin Power Saver to users. |
| 21 static const char kEnableFieldTrial[]; |
| 18 | 22 |
| 19 // Returns the effective content setting for plugins. Passes non-plugin | 23 // Returns the effective content setting for plugins. Passes non-plugin |
| 20 // content settings through without modification. | 24 // content settings through without modification. |
| 21 static ContentSetting EffectiveContentSetting(ContentSettingsType type, | 25 static ContentSetting EffectiveContentSetting(ContentSettingsType type, |
| 22 ContentSetting setting); | 26 ContentSetting setting); |
| 23 | 27 |
| 24 // Returns true if the Plugin Power Saver feature is enabled. | 28 // Returns true if the Plugin Power Saver feature is enabled. |
| 25 static bool IsPluginPowerSaverEnabled(); | 29 static bool IsPluginPowerSaverEnabled(); |
| 26 | 30 |
| 27 // Get the default plugins content setting based on field trials/flags. | 31 // Get the default plugins content setting based on field trials/flags. |
| 28 static ContentSetting GetDefaultPluginsContentSetting(); | 32 static ContentSetting GetDefaultPluginsContentSetting(); |
| 29 | 33 |
| 30 private: | 34 private: |
| 31 DISALLOW_IMPLICIT_CONSTRUCTORS(PluginsFieldTrial); | 35 DISALLOW_IMPLICIT_CONSTRUCTORS(PluginsFieldTrial); |
| 32 }; | 36 }; |
| 33 | 37 |
| 34 } // namespace content_settings | 38 } // namespace content_settings |
| 35 | 39 |
| 36 #endif // COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_CONTENT_SETTINGS_H_ | 40 #endif // COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_CONTENT_SETTINGS_H_ |
| OLD | NEW |