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

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

Issue 13778004: Start in elevated mode when creating a new managed user profile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add a startup elevation flag. Created 7 years, 8 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
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 void RequestAuthorization(content::WebContents* web_contents, 95 void RequestAuthorization(content::WebContents* web_contents,
96 const PassphraseCheckedCallback& callback); 96 const PassphraseCheckedCallback& callback);
97 97
98 // Add an elevation for a specific extension which allows the managed user to 98 // Add an elevation for a specific extension which allows the managed user to
99 // install/uninstall this specific extension. 99 // install/uninstall this specific extension.
100 void AddElevationForExtension(const std::string& extension_id); 100 void AddElevationForExtension(const std::string& extension_id);
101 101
102 // Remove the elevation for a specific extension. 102 // Remove the elevation for a specific extension.
103 void RemoveElevationForExtension(const std::string& extension_id); 103 void RemoveElevationForExtension(const std::string& extension_id);
104 104
105 // Add elevation for |url|. This allows to start a tab displaying this URL
106 // in elevated mode.
107 void AddElevationForURL(const GURL& url);
Bernhard Bauer 2013/04/10 09:30:03 These method declarations are not unnecessary (and
Adrian Kuegel 2013/04/10 09:47:01 I had already implemented them, but forgot to remo
108
109 // Remove elevation for |url|.
110 void RemoveElevationForURL(const GURL& url);
111
112 // Returns if the managed user has elevation for this URL.
113 bool IsElevatedForURL(const GURL& url);
114
105 // Initializes this object. This method does nothing if the profile is not 115 // Initializes this object. This method does nothing if the profile is not
106 // managed. 116 // managed.
107 void Init(); 117 void Init();
108 118
119 void set_startup_elevation(bool elevation) {
120 startup_elevation_ = elevation;
121 }
122
123 bool startup_elevation() const {
124 return startup_elevation_;
125 }
126
109 // extensions::ManagementPolicy::Provider implementation: 127 // extensions::ManagementPolicy::Provider implementation:
110 virtual std::string GetDebugPolicyProviderName() const OVERRIDE; 128 virtual std::string GetDebugPolicyProviderName() const OVERRIDE;
111 virtual bool UserMayLoad(const extensions::Extension* extension, 129 virtual bool UserMayLoad(const extensions::Extension* extension,
112 string16* error) const OVERRIDE; 130 string16* error) const OVERRIDE;
113 virtual bool UserMayModifySettings(const extensions::Extension* extension, 131 virtual bool UserMayModifySettings(const extensions::Extension* extension,
114 string16* error) const OVERRIDE; 132 string16* error) const OVERRIDE;
115 133
116 // content::NotificationObserver implementation: 134 // content::NotificationObserver implementation:
117 virtual void Observe(int type, 135 virtual void Observe(int type,
118 const content::NotificationSource& source, 136 const content::NotificationSource& source,
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 // Updates the manual overrides for URLs in the URL filters when the 190 // Updates the manual overrides for URLs in the URL filters when the
173 // corresponding preference is changed. 191 // corresponding preference is changed.
174 void UpdateManualURLs(); 192 void UpdateManualURLs();
175 193
176 // Returns if the passphrase to authorize as the custodian is empty. 194 // Returns if the passphrase to authorize as the custodian is empty.
177 bool IsPassphraseEmpty() const; 195 bool IsPassphraseEmpty() const;
178 196
179 // Owns us via the ProfileKeyedService mechanism. 197 // Owns us via the ProfileKeyedService mechanism.
180 Profile* profile_; 198 Profile* profile_;
181 199
200 // Is true if the managed user should start in elevated mode.
201 bool startup_elevation_;
202
182 content::NotificationRegistrar registrar_; 203 content::NotificationRegistrar registrar_;
183 PrefChangeRegistrar pref_change_registrar_; 204 PrefChangeRegistrar pref_change_registrar_;
184 205
185 // Stores the extension ids of the extensions which currently can be modified 206 // Stores the extension ids of the extensions which currently can be modified
186 // by the managed user. 207 // by the managed user.
187 std::set<std::string> elevated_for_extensions_; 208 std::set<std::string> elevated_for_extensions_;
188 209
189 URLFilterContext url_filter_context_; 210 URLFilterContext url_filter_context_;
190 }; 211 };
191 212
192 #endif // CHROME_BROWSER_MANAGED_MODE_MANAGED_USER_SERVICE_H_ 213 #endif // CHROME_BROWSER_MANAGED_MODE_MANAGED_USER_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698