| OLD | NEW |
| 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_PLUGIN_PREFS_H_ | 5 #ifndef CHROME_BROWSER_PLUGIN_PREFS_H_ |
| 6 #define CHROME_BROWSER_PLUGIN_PREFS_H_ | 6 #define CHROME_BROWSER_PLUGIN_PREFS_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 class PluginPrefs : public RefcountedProfileKeyedService, | 37 class PluginPrefs : public RefcountedProfileKeyedService, |
| 38 public content::NotificationObserver { | 38 public content::NotificationObserver { |
| 39 public: | 39 public: |
| 40 enum PolicyStatus { | 40 enum PolicyStatus { |
| 41 NO_POLICY = 0, // Neither enabled or disabled by policy. | 41 NO_POLICY = 0, // Neither enabled or disabled by policy. |
| 42 POLICY_ENABLED, | 42 POLICY_ENABLED, |
| 43 POLICY_DISABLED, | 43 POLICY_DISABLED, |
| 44 }; | 44 }; |
| 45 | 45 |
| 46 // Returns the instance associated with |profile|, creating it if necessary. | 46 // Returns the instance associated with |profile|, creating it if necessary. |
| 47 static PluginPrefs* GetForProfile(Profile* profile); | 47 static scoped_refptr<PluginPrefs> GetForProfile(Profile* profile); |
| 48 | 48 |
| 49 // Usually the PluginPrefs associated with a TestingProfile is NULL. | 49 // Usually the PluginPrefs associated with a TestingProfile is NULL. |
| 50 // This method overrides that for a given TestingProfile, returning the newly | 50 // This method overrides that for a given TestingProfile, returning the newly |
| 51 // created PluginPrefs object. | 51 // created PluginPrefs object. |
| 52 static PluginPrefs* GetForTestingProfile(Profile* profile); | 52 static scoped_refptr<PluginPrefs> GetForTestingProfile(Profile* profile); |
| 53 | 53 |
| 54 // Sets the plug-in list for tests. | 54 // Sets the plug-in list for tests. |
| 55 void SetPluginListForTesting(webkit::npapi::PluginList* plugin_list); | 55 void SetPluginListForTesting(webkit::npapi::PluginList* plugin_list); |
| 56 | 56 |
| 57 // Creates a new instance. This method should only be used for testing. | 57 // Creates a new instance. This method should only be used for testing. |
| 58 PluginPrefs(); | 58 PluginPrefs(); |
| 59 | 59 |
| 60 // Associates this instance with |prefs|. This enables or disables | 60 // Associates this instance with |prefs|. This enables or disables |
| 61 // plugin groups as defined by the user's preferences. | 61 // plugin groups as defined by the user's preferences. |
| 62 // This method should only be called on the UI thread. | 62 // This method should only be called on the UI thread. |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 // PluginList to use for testing. If this is NULL, defaults to the global | 158 // PluginList to use for testing. If this is NULL, defaults to the global |
| 159 // singleton. | 159 // singleton. |
| 160 webkit::npapi::PluginList* plugin_list_; | 160 webkit::npapi::PluginList* plugin_list_; |
| 161 | 161 |
| 162 PrefChangeRegistrar registrar_; | 162 PrefChangeRegistrar registrar_; |
| 163 | 163 |
| 164 DISALLOW_COPY_AND_ASSIGN(PluginPrefs); | 164 DISALLOW_COPY_AND_ASSIGN(PluginPrefs); |
| 165 }; | 165 }; |
| 166 | 166 |
| 167 #endif // CHROME_BROWSER_PLUGIN_PREFS_H_ | 167 #endif // CHROME_BROWSER_PLUGIN_PREFS_H_ |
| OLD | NEW |