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. 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 |
83 // managed after the ManagedUserService has been created (which happens when | 84 // managed after the ManagedUserService has been created (which happens when |
84 // creating a new profile). | 85 // creating a new profile). |
85 void Init(); | 86 void Init(); |
86 | 87 |
87 // ExtensionManagementPolicy::Provider implementation: | 88 // ExtensionManagementPolicy::Provider implementation: |
88 virtual std::string GetDebugPolicyProviderName() const OVERRIDE; | 89 virtual std::string GetDebugPolicyProviderName() const OVERRIDE; |
89 virtual bool UserMayLoad(const extensions::Extension* extension, | 90 virtual bool UserMayLoad(const extensions::Extension* extension, |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 // example). | 159 // example). |
159 bool is_elevated_; | 160 bool is_elevated_; |
160 | 161 |
161 content::NotificationRegistrar registrar_; | 162 content::NotificationRegistrar registrar_; |
162 PrefChangeRegistrar pref_change_registrar_; | 163 PrefChangeRegistrar pref_change_registrar_; |
163 | 164 |
164 URLFilterContext url_filter_context_; | 165 URLFilterContext url_filter_context_; |
165 }; | 166 }; |
166 | 167 |
167 #endif // CHROME_BROWSER_MANAGED_MODE_MANAGED_USER_SERVICE_H_ | 168 #endif // CHROME_BROWSER_MANAGED_MODE_MANAGED_USER_SERVICE_H_ |
OLD | NEW |