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 <set> | 8 #include <set> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 25 matching lines...) Expand all Loading... | |
36 enum ManualBehavior { | 36 enum ManualBehavior { |
37 MANUAL_NONE = 0, | 37 MANUAL_NONE = 0, |
38 MANUAL_ALLOW, | 38 MANUAL_ALLOW, |
39 MANUAL_BLOCK | 39 MANUAL_BLOCK |
40 }; | 40 }; |
41 | 41 |
42 explicit ManagedUserService(Profile* profile); | 42 explicit ManagedUserService(Profile* profile); |
43 virtual ~ManagedUserService(); | 43 virtual ~ManagedUserService(); |
44 | 44 |
45 bool ProfileIsManaged() const; | 45 bool ProfileIsManaged() const; |
46 bool IsElevated() const; | 46 bool IsElevated() const; |
Bernhard Bauer
2013/03/20 15:08:30
Aaand now this is getting confusing. How do per-pr
Adrian Kuegel
2013/03/20 15:51:16
No, we don't want that anymore, but I guess if I c
Bernhard Bauer
2013/03/20 15:57:17
OK, but please add a deprecation message in that c
| |
47 | 47 |
48 // Returns the elevation state for specific WebContents. | |
49 bool IsElevatedForWebContents(const content::WebContents* web_contents) const; | |
50 | |
48 static void RegisterUserPrefs(PrefRegistrySyncable* registry); | 51 static void RegisterUserPrefs(PrefRegistrySyncable* registry); |
49 | 52 |
50 // Returns the URL filter for the IO thread, for filtering network requests | 53 // Returns the URL filter for the IO thread, for filtering network requests |
51 // (in ManagedModeResourceThrottle). | 54 // (in ManagedModeResourceThrottle). |
52 scoped_refptr<const ManagedModeURLFilter> GetURLFilterForIOThread(); | 55 scoped_refptr<const ManagedModeURLFilter> GetURLFilterForIOThread(); |
53 | 56 |
54 // Returns the URL filter for the UI thread, for filtering navigations and | 57 // Returns the URL filter for the UI thread, for filtering navigations and |
55 // classifying sites in the history view. | 58 // classifying sites in the history view. |
56 ManagedModeURLFilter* GetURLFilterForUIThread(); | 59 ManagedModeURLFilter* GetURLFilterForUIThread(); |
57 | 60 |
(...skipping 20 matching lines...) Expand all Loading... | |
78 ManualBehavior GetManualBehaviorForURL(const GURL& url); | 81 ManualBehavior GetManualBehaviorForURL(const GURL& url); |
79 | 82 |
80 // Sets the manual behavior for the given URL. | 83 // Sets the manual behavior for the given URL. |
81 void SetManualBehaviorForURLs(const std::vector<GURL>& url, | 84 void SetManualBehaviorForURLs(const std::vector<GURL>& url, |
82 ManualBehavior behavior); | 85 ManualBehavior behavior); |
83 | 86 |
84 // Checks if the passphrase dialog can be skipped (the profile is already in | 87 // Checks if the passphrase dialog can be skipped (the profile is already in |
85 // elevated state or the passphrase is empty). | 88 // elevated state or the passphrase is empty). |
86 bool CanSkipPassphraseDialog(); | 89 bool CanSkipPassphraseDialog(); |
87 | 90 |
91 // Checks if the passphrase dialog can be skipped (the profile is already in | |
92 // elevated state for the given WebContents or the passphrase is empty). | |
93 bool CanSkipPassphraseDialog(const content::WebContents* web_contents) const; | |
94 | |
95 // Returns if the passphrase to authorize as the custodian is empty. | |
96 bool IsPassphraseEmpty() const; | |
97 | |
88 // Handles the request to authorize as the custodian of the managed user. | 98 // Handles the request to authorize as the custodian of the managed user. |
89 void RequestAuthorization(content::WebContents* web_contents, | 99 void RequestAuthorization(content::WebContents* web_contents, |
90 const PassphraseCheckedCallback& callback); | 100 const PassphraseCheckedCallback& callback); |
91 | 101 |
92 // Handles the request to authorize as the custodian of the managed user. | 102 // Handles the request to authorize as the custodian of the managed user. |
93 // Also determines the active web contents to be passed to the passphrase | 103 // Also determines the active web contents to be passed to the passphrase |
94 // dialog. | 104 // dialog. |
95 void RequestAuthorizationUsingActiveWebContents( | 105 void RequestAuthorizationUsingActiveWebContents( |
96 Browser* browser, | 106 Browser* browser, |
97 const PassphraseCheckedCallback& callback); | 107 const PassphraseCheckedCallback& callback); |
98 | 108 |
109 // Set the elevation state for the profile. | |
99 void SetElevated(bool is_elevated); | 110 void SetElevated(bool is_elevated); |
100 | 111 |
112 // Set the elevation state for specific WebContents only. | |
113 void SetElevatedForWebContents(bool is_elevated, | |
114 content::WebContents* web_contents); | |
115 | |
101 // Add an elevation for a specific extension which allows the managed user to | 116 // Add an elevation for a specific extension which allows the managed user to |
102 // install/uninstall this specific extension. | 117 // install/uninstall this specific extension. |
103 void AddElevationForExtension(const std::string& extension_id); | 118 void AddElevationForExtension(const std::string& extension_id); |
104 | 119 |
105 // Remove the elevation for a specific extension. | 120 // Remove the elevation for a specific extension. |
106 void RemoveElevationForExtension(const std::string& extension_id); | 121 void RemoveElevationForExtension(const std::string& extension_id); |
107 | 122 |
108 // Initializes this object. This method does nothing if the profile is not | 123 // Initializes this object. This method does nothing if the profile is not |
109 // managed. | 124 // managed. |
110 void Init(); | 125 void Init(); |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
188 PrefChangeRegistrar pref_change_registrar_; | 203 PrefChangeRegistrar pref_change_registrar_; |
189 | 204 |
190 // Stores the extension ids of the extensions which currently can be modified | 205 // Stores the extension ids of the extensions which currently can be modified |
191 // by the managed user. | 206 // by the managed user. |
192 std::set<std::string> elevated_for_extensions_; | 207 std::set<std::string> elevated_for_extensions_; |
193 | 208 |
194 URLFilterContext url_filter_context_; | 209 URLFilterContext url_filter_context_; |
195 }; | 210 }; |
196 | 211 |
197 #endif // CHROME_BROWSER_MANAGED_MODE_MANAGED_USER_SERVICE_H_ | 212 #endif // CHROME_BROWSER_MANAGED_MODE_MANAGED_USER_SERVICE_H_ |
OLD | NEW |