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 21 matching lines...) Expand all Loading... |
32 enum ManualBehavior { | 32 enum ManualBehavior { |
33 MANUAL_NONE = 0, | 33 MANUAL_NONE = 0, |
34 MANUAL_ALLOW, | 34 MANUAL_ALLOW, |
35 MANUAL_BLOCK | 35 MANUAL_BLOCK |
36 }; | 36 }; |
37 | 37 |
38 explicit ManagedUserService(Profile* profile); | 38 explicit ManagedUserService(Profile* profile); |
39 virtual ~ManagedUserService(); | 39 virtual ~ManagedUserService(); |
40 | 40 |
41 bool ProfileIsManaged() const; | 41 bool ProfileIsManaged() const; |
| 42 bool IsElevated() const; |
42 | 43 |
43 static void RegisterUserPrefs(PrefRegistrySyncable* registry); | 44 static void RegisterUserPrefs(PrefRegistrySyncable* registry); |
44 | 45 |
45 // Returns the URL filter for the IO thread, for filtering network requests | 46 // Returns the URL filter for the IO thread, for filtering network requests |
46 // (in ManagedModeResourceThrottle). | 47 // (in ManagedModeResourceThrottle). |
47 scoped_refptr<const ManagedModeURLFilter> GetURLFilterForIOThread(); | 48 scoped_refptr<const ManagedModeURLFilter> GetURLFilterForIOThread(); |
48 | 49 |
49 // Returns the URL filter for the UI thread, for filtering navigations and | 50 // Returns the URL filter for the UI thread, for filtering navigations and |
50 // classifying sites in the history view. | 51 // classifying sites in the history view. |
51 ManagedModeURLFilter* GetURLFilterForUIThread(); | 52 ManagedModeURLFilter* GetURLFilterForUIThread(); |
(...skipping 17 matching lines...) Expand all Loading... |
69 void SetManualBehaviorForHosts(const std::vector<std::string>& hostnames, | 70 void SetManualBehaviorForHosts(const std::vector<std::string>& hostnames, |
70 ManualBehavior behavior); | 71 ManualBehavior behavior); |
71 | 72 |
72 // Returns the manual behavior for the given URL. | 73 // Returns the manual behavior for the given URL. |
73 ManualBehavior GetManualBehaviorForURL(const GURL& url); | 74 ManualBehavior GetManualBehaviorForURL(const GURL& url); |
74 | 75 |
75 // Sets the manual behavior for the given URL. | 76 // Sets the manual behavior for the given URL. |
76 void SetManualBehaviorForURLs(const std::vector<GURL>& url, | 77 void SetManualBehaviorForURLs(const std::vector<GURL>& url, |
77 ManualBehavior behavior); | 78 ManualBehavior behavior); |
78 | 79 |
79 void SetElevatedForTesting(bool is_elevated); | 80 void SetElevated(bool is_elevated); |
80 | 81 |
81 // 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 |
82 // managed. | 83 // managed. |
83 void Init(); | 84 void Init(); |
84 | 85 |
85 // extensions::ManagementPolicy::Provider implementation: | 86 // extensions::ManagementPolicy::Provider implementation: |
86 virtual std::string GetDebugPolicyProviderName() const OVERRIDE; | 87 virtual std::string GetDebugPolicyProviderName() const OVERRIDE; |
87 virtual bool UserMayLoad(const extensions::Extension* extension, | 88 virtual bool UserMayLoad(const extensions::Extension* extension, |
88 string16* error) const OVERRIDE; | 89 string16* error) const OVERRIDE; |
89 virtual bool UserMayModifySettings(const extensions::Extension* extension, | 90 virtual bool UserMayModifySettings(const extensions::Extension* extension, |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 // example). | 157 // example). |
157 bool is_elevated_; | 158 bool is_elevated_; |
158 | 159 |
159 content::NotificationRegistrar registrar_; | 160 content::NotificationRegistrar registrar_; |
160 PrefChangeRegistrar pref_change_registrar_; | 161 PrefChangeRegistrar pref_change_registrar_; |
161 | 162 |
162 URLFilterContext url_filter_context_; | 163 URLFilterContext url_filter_context_; |
163 }; | 164 }; |
164 | 165 |
165 #endif // CHROME_BROWSER_MANAGED_MODE_MANAGED_USER_SERVICE_H_ | 166 #endif // CHROME_BROWSER_MANAGED_MODE_MANAGED_USER_SERVICE_H_ |
OLD | NEW |