Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(133)

Side by Side Diff: chrome/browser/managed_mode/managed_user_service.h

Issue 15715005: Remove passphrase dialog and last parts of elevation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
11 #include "base/memory/scoped_ptr.h" 11 #include "base/memory/scoped_ptr.h"
12 #include "base/prefs/pref_change_registrar.h" 12 #include "base/prefs/pref_change_registrar.h"
13 #include "base/string16.h" 13 #include "base/string16.h"
14 #include "chrome/browser/extensions/management_policy.h" 14 #include "chrome/browser/extensions/management_policy.h"
15 #include "chrome/browser/managed_mode/managed_mode_url_filter.h" 15 #include "chrome/browser/managed_mode/managed_mode_url_filter.h"
16 #include "chrome/browser/ui/webui/managed_user_passphrase_dialog.h"
17 #include "components/browser_context_keyed_service/browser_context_keyed_service .h" 16 #include "components/browser_context_keyed_service/browser_context_keyed_service .h"
18 #include "content/public/browser/notification_observer.h" 17 #include "content/public/browser/notification_observer.h"
19 #include "content/public/browser/notification_registrar.h" 18 #include "content/public/browser/notification_registrar.h"
20 #include "content/public/browser/web_contents.h" 19 #include "content/public/browser/web_contents.h"
21 20
22 class Browser; 21 class Browser;
23 class GoogleServiceAuthError; 22 class GoogleServiceAuthError;
24 class ManagedModeURLFilter; 23 class ManagedModeURLFilter;
25 class ManagedModeSiteList; 24 class ManagedModeSiteList;
26 class ManagedUserRegistrationService; 25 class ManagedUserRegistrationService;
(...skipping 20 matching lines...) Expand all
47 46
48 explicit ManagedUserService(Profile* profile); 47 explicit ManagedUserService(Profile* profile);
49 virtual ~ManagedUserService(); 48 virtual ~ManagedUserService();
50 49
51 bool ProfileIsManaged() const; 50 bool ProfileIsManaged() const;
52 51
53 // Checks whether the given profile is managed without constructing a 52 // Checks whether the given profile is managed without constructing a
54 // ManagedUserService (which could lead to cyclic dependencies). 53 // ManagedUserService (which could lead to cyclic dependencies).
55 static bool ProfileIsManaged(Profile* profile); 54 static bool ProfileIsManaged(Profile* profile);
56 55
57 // Returns the elevation state for specific WebContents.
58 bool IsElevatedForWebContents(const content::WebContents* web_contents) const;
59
60 static void RegisterUserPrefs(user_prefs::PrefRegistrySyncable* registry); 56 static void RegisterUserPrefs(user_prefs::PrefRegistrySyncable* registry);
61 57
62 // Returns whether managed users are enabled by Finch or the command line 58 // Returns whether managed users are enabled by Finch or the command line
63 // flag. 59 // flag.
64 static bool AreManagedUsersEnabled(); 60 static bool AreManagedUsersEnabled();
65 61
66 // Returns the URL filter for the IO thread, for filtering network requests 62 // Returns the URL filter for the IO thread, for filtering network requests
67 // (in ManagedModeResourceThrottle). 63 // (in ManagedModeResourceThrottle).
68 scoped_refptr<const ManagedModeURLFilter> GetURLFilterForIOThread(); 64 scoped_refptr<const ManagedModeURLFilter> GetURLFilterForIOThread();
69 65
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 ManualBehavior GetManualBehaviorForURL(const GURL& url); 98 ManualBehavior GetManualBehaviorForURL(const GURL& url);
103 99
104 // Sets the manual behavior for the given URL. 100 // Sets the manual behavior for the given URL.
105 void SetManualBehaviorForURLs(const std::vector<GURL>& url, 101 void SetManualBehaviorForURLs(const std::vector<GURL>& url,
106 ManualBehavior behavior); 102 ManualBehavior behavior);
107 103
108 // Returns all URLS on the given host that have exceptions. 104 // Returns all URLS on the given host that have exceptions.
109 void GetManualExceptionsForHost(const std::string& host, 105 void GetManualExceptionsForHost(const std::string& host,
110 std::vector<GURL>* urls); 106 std::vector<GURL>* urls);
111 107
112 // Checks if the passphrase dialog can be skipped (the profile is already in
113 // elevated state for the given WebContents or the passphrase is empty).
114 bool CanSkipPassphraseDialog(const content::WebContents* web_contents) const;
115
116 // Handles the request to authorize as the custodian of the managed user.
117 void RequestAuthorization(content::WebContents* web_contents,
118 const PassphraseCheckedCallback& callback);
119
120 // Initializes this object. This method does nothing if the profile is not 108 // Initializes this object. This method does nothing if the profile is not
121 // managed. 109 // managed.
122 void Init(); 110 void Init();
123 111
124 // Marks the profile as managed and initializes it. 112 // Marks the profile as managed and initializes it.
125 void InitForTesting(); 113 void InitForTesting();
126 114
127 // Initializes this profile for syncing, using the provided |token| to 115 // Initializes this profile for syncing, using the provided |token| to
128 // authenticate requests. 116 // authenticate requests.
129 void InitSync(const std::string& token); 117 void InitSync(const std::string& token);
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 void UpdateSiteLists(); 194 void UpdateSiteLists();
207 195
208 // Updates the manual overrides for hosts in the URL filters when the 196 // Updates the manual overrides for hosts in the URL filters when the
209 // corresponding preference is changed. 197 // corresponding preference is changed.
210 void UpdateManualHosts(); 198 void UpdateManualHosts();
211 199
212 // Updates the manual overrides for URLs in the URL filters when the 200 // Updates the manual overrides for URLs in the URL filters when the
213 // corresponding preference is changed. 201 // corresponding preference is changed.
214 void UpdateManualURLs(); 202 void UpdateManualURLs();
215 203
216 // Returns if the passphrase to authorize as the custodian is empty.
217 bool IsPassphraseEmpty() const;
218
219 base::WeakPtrFactory<ManagedUserService> weak_ptr_factory_; 204 base::WeakPtrFactory<ManagedUserService> weak_ptr_factory_;
220 205
221 // Owns us via the BrowserContextKeyedService mechanism. 206 // Owns us via the BrowserContextKeyedService mechanism.
222 Profile* profile_; 207 Profile* profile_;
223 208
224 content::NotificationRegistrar registrar_; 209 content::NotificationRegistrar registrar_;
225 PrefChangeRegistrar pref_change_registrar_; 210 PrefChangeRegistrar pref_change_registrar_;
226 211
227 // Stores the extension ids of the extensions which currently can be modified
228 // by the managed user.
229 std::set<std::string> elevated_for_extensions_;
230
231 // Sets a profile in elevated state for testing if set to true. 212 // Sets a profile in elevated state for testing if set to true.
232 bool elevated_for_testing_; 213 bool elevated_for_testing_;
233 214
234 URLFilterContext url_filter_context_; 215 URLFilterContext url_filter_context_;
235 }; 216 };
236 217
237 #endif // CHROME_BROWSER_MANAGED_MODE_MANAGED_USER_SERVICE_H_ 218 #endif // CHROME_BROWSER_MANAGED_MODE_MANAGED_USER_SERVICE_H_
OLDNEW
« no previous file with comments | « chrome/browser/managed_mode/managed_user_passphrase_unittest.cc ('k') | chrome/browser/managed_mode/managed_user_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698