| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_MANAGED_MODE_MANAGED_USER_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_MANAGED_MODE_MANAGED_USER_SERVICE_H_ |
| 6 #define CHROME_BROWSER_MANAGED_MODE_MANAGED_USER_SERVICE_H_ | 6 #define CHROME_BROWSER_MANAGED_MODE_MANAGED_USER_SERVICE_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/prefs/public/pref_change_registrar.h" | 10 #include "base/prefs/public/pref_change_registrar.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 public extensions::ManagementPolicy::Provider, | 27 public extensions::ManagementPolicy::Provider, |
| 28 public content::NotificationObserver { | 28 public content::NotificationObserver { |
| 29 public: | 29 public: |
| 30 typedef std::vector<string16> CategoryList; | 30 typedef std::vector<string16> CategoryList; |
| 31 | 31 |
| 32 explicit ManagedUserService(Profile* profile); | 32 explicit ManagedUserService(Profile* profile); |
| 33 virtual ~ManagedUserService(); | 33 virtual ~ManagedUserService(); |
| 34 | 34 |
| 35 bool ProfileIsManaged() const; | 35 bool ProfileIsManaged() const; |
| 36 | 36 |
| 37 bool IsElevated() const; |
| 38 |
| 37 static void RegisterUserPrefs(PrefServiceSyncable* prefs); | 39 static void RegisterUserPrefs(PrefServiceSyncable* prefs); |
| 38 | 40 |
| 39 // Returns the URL filter for the IO thread, for filtering network requests | 41 // Returns the URL filter for the IO thread, for filtering network requests |
| 40 // (in ManagedModeResourceThrottle). | 42 // (in ManagedModeResourceThrottle). |
| 41 scoped_refptr<const ManagedModeURLFilter> GetURLFilterForIOThread(); | 43 scoped_refptr<const ManagedModeURLFilter> GetURLFilterForIOThread(); |
| 42 | 44 |
| 43 // Returns the URL filter for the UI thread, for filtering navigations and | 45 // Returns the URL filter for the UI thread, for filtering navigations and |
| 44 // classifying sites in the history view. | 46 // classifying sites in the history view. |
| 45 ManagedModeURLFilter* GetURLFilterForUIThread(); | 47 ManagedModeURLFilter* GetURLFilterForUIThread(); |
| 46 | 48 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 68 void AddToManualList(const bool is_whitelist, const base::ListValue& list); | 70 void AddToManualList(const bool is_whitelist, const base::ListValue& list); |
| 69 | 71 |
| 70 // Removes |list| from the manual white/black list (according to | 72 // Removes |list| from the manual white/black list (according to |
| 71 // |is_whitelist|) both in URL filter and in preferences. | 73 // |is_whitelist|) both in URL filter and in preferences. |
| 72 void RemoveFromManualList(const bool is_whitelist, | 74 void RemoveFromManualList(const bool is_whitelist, |
| 73 const base::ListValue& list); | 75 const base::ListValue& list); |
| 74 | 76 |
| 75 // Updates the whitelist and the blacklist from the prefs. | 77 // Updates the whitelist and the blacklist from the prefs. |
| 76 void UpdateManualLists(); | 78 void UpdateManualLists(); |
| 77 | 79 |
| 78 void SetElevatedForTesting(bool is_elevated); | 80 void SetElevated(bool is_elevated); |
| 79 | 81 |
| 80 // Initializes this object. This method does nothing if the profile is not | 82 // Initializes this object. This method does nothing if the profile is not |
| 81 // managed. This method only needs to be called if the profile is set to be | 83 // managed. This method only needs to be called if the profile is set to be |
| 82 // managed after the ManagedUserService has been created (which happens when | 84 // managed after the ManagedUserService has been created (which happens when |
| 83 // creating a new profile). | 85 // creating a new profile). |
| 84 void Init(); | 86 void Init(); |
| 85 | 87 |
| 86 // ExtensionManagementPolicy::Provider implementation: | 88 // ExtensionManagementPolicy::Provider implementation: |
| 87 virtual std::string GetDebugPolicyProviderName() const OVERRIDE; | 89 virtual std::string GetDebugPolicyProviderName() const OVERRIDE; |
| 88 virtual bool UserMayLoad(const extensions::Extension* extension, | 90 virtual bool UserMayLoad(const extensions::Extension* extension, |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 // example). | 164 // example). |
| 163 bool is_elevated_; | 165 bool is_elevated_; |
| 164 | 166 |
| 165 content::NotificationRegistrar registrar_; | 167 content::NotificationRegistrar registrar_; |
| 166 PrefChangeRegistrar pref_change_registrar_; | 168 PrefChangeRegistrar pref_change_registrar_; |
| 167 | 169 |
| 168 URLFilterContext url_filter_context_; | 170 URLFilterContext url_filter_context_; |
| 169 }; | 171 }; |
| 170 | 172 |
| 171 #endif // CHROME_BROWSER_MANAGED_MODE_MANAGED_USER_SERVICE_H_ | 173 #endif // CHROME_BROWSER_MANAGED_MODE_MANAGED_USER_SERVICE_H_ |
| OLD | NEW |