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

Side by Side Diff: chrome/browser/supervised_user/supervised_user_service.h

Issue 925563002: Supervised users: Slightly relax restrictions around extensions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@test_ext_install_disable
Patch Set: rebase Created 5 years, 10 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_SUPERVISED_USER_SUPERVISED_USER_SERVICE_H_ 5 #ifndef CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_SERVICE_H_
6 #define CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_SERVICE_H_ 6 #define CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_SERVICE_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 155
156 void AddNavigationBlockedCallback(const NavigationBlockedCallback& callback); 156 void AddNavigationBlockedCallback(const NavigationBlockedCallback& callback);
157 void DidBlockNavigation(content::WebContents* web_contents); 157 void DidBlockNavigation(content::WebContents* web_contents);
158 158
159 void AddObserver(SupervisedUserServiceObserver* observer); 159 void AddObserver(SupervisedUserServiceObserver* observer);
160 void RemoveObserver(SupervisedUserServiceObserver* observer); 160 void RemoveObserver(SupervisedUserServiceObserver* observer);
161 161
162 void AddPermissionRequestCreator( 162 void AddPermissionRequestCreator(
163 scoped_ptr<PermissionRequestCreator> creator); 163 scoped_ptr<PermissionRequestCreator> creator);
164 164
165 #if defined(ENABLE_EXTENSIONS)
166 // extensions::ManagementPolicy::Provider implementation:
167 std::string GetDebugPolicyProviderName() const override;
168 bool UserMayLoad(const extensions::Extension* extension,
169 base::string16* error) const override;
170 bool UserMayModifySettings(const extensions::Extension* extension,
171 base::string16* error) const override;
172 #endif
173
174 // SyncTypePreferenceProvider implementation: 165 // SyncTypePreferenceProvider implementation:
175 syncer::ModelTypeSet GetPreferredDataTypes() const override; 166 syncer::ModelTypeSet GetPreferredDataTypes() const override;
176 167
177 // ProfileSyncServiceObserver implementation: 168 // ProfileSyncServiceObserver implementation:
178 void OnStateChanged() override; 169 void OnStateChanged() override;
179 170
180 // chrome::BrowserListObserver implementation: 171 // chrome::BrowserListObserver implementation:
181 void OnBrowserSetLastActive(Browser* browser) override; 172 void OnBrowserSetLastActive(Browser* browser) override;
182 173
183 // SupervisedUserURLFilter::Observer implementation: 174 // SupervisedUserURLFilter::Observer implementation:
184 void OnSiteListUpdated() override; 175 void OnSiteListUpdated() override;
185 176
186 private: 177 private:
187 friend class SupervisedUserServiceExtensionTestBase; 178 friend class SupervisedUserServiceExtensionTestBase;
188 friend class SupervisedUserServiceFactory; 179 friend class SupervisedUserServiceFactory;
189 FRIEND_TEST_ALL_PREFIXES(SingleClientSupervisedUserSettingsSyncTest, Sanity); 180 FRIEND_TEST_ALL_PREFIXES(SingleClientSupervisedUserSettingsSyncTest, Sanity);
190 FRIEND_TEST_ALL_PREFIXES(SupervisedUserServiceTest, ClearOmitOnRegistration); 181 FRIEND_TEST_ALL_PREFIXES(SupervisedUserServiceTest, ClearOmitOnRegistration);
191 FRIEND_TEST_ALL_PREFIXES(SupervisedUserServiceTest, 182 FRIEND_TEST_ALL_PREFIXES(SupervisedUserServiceTest,
192 ChangesIncludedSessionOnChangedSettings); 183 ChangesIncludedSessionOnChangedSettings);
193 FRIEND_TEST_ALL_PREFIXES(SupervisedUserServiceTest, 184 FRIEND_TEST_ALL_PREFIXES(SupervisedUserServiceTest,
194 ChangesSyncSessionStateOnChangedSettings); 185 ChangesSyncSessionStateOnChangedSettings);
186 FRIEND_TEST_ALL_PREFIXES(SupervisedUserServiceExtensionTest,
187 ExtensionManagementPolicyProvider);
195 188
196 // A bridge from the UI thread to the SupervisedUserURLFilters, one of which 189 // A bridge from the UI thread to the SupervisedUserURLFilters, one of which
197 // lives on the IO thread. This class mediates access to them and makes sure 190 // lives on the IO thread. This class mediates access to them and makes sure
198 // they are kept in sync. 191 // they are kept in sync.
199 class URLFilterContext { 192 class URLFilterContext {
200 public: 193 public:
201 URLFilterContext(); 194 URLFilterContext();
202 ~URLFilterContext(); 195 ~URLFilterContext();
203 196
204 SupervisedUserURLFilter* ui_url_filter() const; 197 SupervisedUserURLFilter* ui_url_filter() const;
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 void SetupSync(); 245 void SetupSync();
253 void StartSetupSync(); 246 void StartSetupSync();
254 void FinishSetupSyncWhenReady(); 247 void FinishSetupSyncWhenReady();
255 void FinishSetupSync(); 248 void FinishSetupSync();
256 249
257 bool ProfileIsSupervised() const; 250 bool ProfileIsSupervised() const;
258 251
259 void OnCustodianInfoChanged(); 252 void OnCustodianInfoChanged();
260 253
261 #if defined(ENABLE_EXTENSIONS) 254 #if defined(ENABLE_EXTENSIONS)
262 // Internal implementation for ExtensionManagementPolicy::Delegate methods. 255 // extensions::ManagementPolicy::Provider implementation:
263 // If |error| is not NULL, it will be filled with an error message if the 256 std::string GetDebugPolicyProviderName() const override;
264 // requested extension action (install, modify status, etc.) is not permitted. 257 bool UserMayLoad(const extensions::Extension* extension,
265 bool ExtensionManagementPolicyImpl(const extensions::Extension* extension, 258 base::string16* error) const override;
266 base::string16* error) const; 259 bool MustRemainInstalled(const extensions::Extension* extension,
260 base::string16* error) const override;
267 261
268 // Extensions helper to SetActive(). 262 // Extensions helper to SetActive().
269 void SetExtensionsActive(); 263 void SetExtensionsActive();
270 #endif 264 #endif
271 265
272 SupervisedUserSettingsService* GetSettingsService(); 266 SupervisedUserSettingsService* GetSettingsService();
273 267
274 size_t FindEnabledPermissionRequestCreator(size_t start); 268 size_t FindEnabledPermissionRequestCreator(size_t start);
275 void AddAccessRequestInternal(const GURL& url, 269 void AddAccessRequestInternal(const GURL& url,
276 const SuccessCallback& callback, 270 const SuccessCallback& callback,
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 346
353 // Used to create permission requests. 347 // Used to create permission requests.
354 ScopedVector<PermissionRequestCreator> permissions_creators_; 348 ScopedVector<PermissionRequestCreator> permissions_creators_;
355 349
356 ObserverList<SupervisedUserServiceObserver> observer_list_; 350 ObserverList<SupervisedUserServiceObserver> observer_list_;
357 351
358 base::WeakPtrFactory<SupervisedUserService> weak_ptr_factory_; 352 base::WeakPtrFactory<SupervisedUserService> weak_ptr_factory_;
359 }; 353 };
360 354
361 #endif // CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_SERVICE_H_ 355 #endif // CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_SERVICE_H_
OLDNEW
« no previous file with comments | « chrome/browser/resources/extensions/extension_list.js ('k') | chrome/browser/supervised_user/supervised_user_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698