Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 <set> | 8 #include <set> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 180 // ProfileSyncServiceObserver implementation: | 180 // ProfileSyncServiceObserver implementation: |
| 181 virtual void OnStateChanged() OVERRIDE; | 181 virtual void OnStateChanged() OVERRIDE; |
| 182 | 182 |
| 183 // chrome::BrowserListObserver implementation: | 183 // chrome::BrowserListObserver implementation: |
| 184 virtual void OnBrowserSetLastActive(Browser* browser) OVERRIDE; | 184 virtual void OnBrowserSetLastActive(Browser* browser) OVERRIDE; |
| 185 | 185 |
| 186 private: | 186 private: |
| 187 friend class SupervisedUserServiceExtensionTestBase; | 187 friend class SupervisedUserServiceExtensionTestBase; |
| 188 friend class SupervisedUserServiceFactory; | 188 friend class SupervisedUserServiceFactory; |
| 189 FRIEND_TEST_ALL_PREFIXES(SupervisedUserServiceTest, ClearOmitOnRegistration); | 189 FRIEND_TEST_ALL_PREFIXES(SupervisedUserServiceTest, ClearOmitOnRegistration); |
| 190 | 190 FRIEND_TEST_ALL_PREFIXES(SupervisedUserServiceTest, |
| 191 ChangesIncludedSessionOnChangedSettings); | |
| 192 FRIEND_TEST_ALL_PREFIXES(SupervisedUserServiceTest, | |
| 193 ChangesSyncSessionStateOnChangedSettings); | |
| 191 // A bridge from the UI thread to the SupervisedUserURLFilters, one of which | 194 // A bridge from the UI thread to the SupervisedUserURLFilters, one of which |
| 192 // lives on the IO thread. This class mediates access to them and makes sure | 195 // lives on the IO thread. This class mediates access to them and makes sure |
| 193 // they are kept in sync. | 196 // they are kept in sync. |
| 194 class URLFilterContext { | 197 class URLFilterContext { |
| 195 public: | 198 public: |
| 196 URLFilterContext(); | 199 URLFilterContext(); |
| 197 ~URLFilterContext(); | 200 ~URLFilterContext(); |
| 198 | 201 |
| 199 SupervisedUserURLFilter* ui_url_filter() const; | 202 SupervisedUserURLFilter* ui_url_filter() const; |
| 200 SupervisedUserURLFilter* io_url_filter() const; | 203 SupervisedUserURLFilter* io_url_filter() const; |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 265 // corresponding preference is changed. | 268 // corresponding preference is changed. |
| 266 void UpdateManualHosts(); | 269 void UpdateManualHosts(); |
| 267 | 270 |
| 268 // Updates the manual overrides for URLs in the URL filters when the | 271 // Updates the manual overrides for URLs in the URL filters when the |
| 269 // corresponding preference is changed. | 272 // corresponding preference is changed. |
| 270 void UpdateManualURLs(); | 273 void UpdateManualURLs(); |
| 271 | 274 |
| 272 // Returns the human readable name of the supervised user. | 275 // Returns the human readable name of the supervised user. |
| 273 std::string GetSupervisedUserName() const; | 276 std::string GetSupervisedUserName() const; |
| 274 | 277 |
| 278 // Gets attached to the SupervisedUserSettingsService and writes into | |
| 279 // includes_session_sync_ if the history may be recorded. | |
|
Marc Treib
2014/08/19 15:28:02
nit: "may be" -> "should be"
Bernhard Bauer
2014/08/19 17:11:13
Nit: pipes around |includes_session_sync_|.
Pam (message me for reviews)
2014/08/19 20:17:16
"Attached to" isn't the customary terminology, so
fhorschig
2014/08/20 11:59:30
Done.
fhorschig
2014/08/20 11:59:30
Done.
fhorschig
2014/08/20 11:59:30
Done.
| |
| 280 void OnNewSettingsAvailable(const base::DictionaryValue* settings); | |
| 281 | |
| 282 // Reads the state of |includes_session_sync_| from given SU settings. The | |
| 283 // returned | |
|
Marc Treib
2014/08/19 15:28:01
nit: Combine with the line below.
fhorschig
2014/08/20 11:59:30
Done.
| |
| 284 // value indicates if |includes_session_sync_| has changed. | |
| 285 bool FetchNewSessionSyncState(const base::DictionaryValue* settings); | |
| 286 | |
| 287 // Reinitializing this Service means reloading the Sync settings. This method | |
|
Pam (message me for reviews)
2014/08/19 20:17:16
Reconfiguring
But then why not just name it "Relo
Marc Treib
2014/08/20 10:04:55
Because it's not clear what "sync settings" means.
| |
| 288 // thereby ensures that changes in Sync settings take effect immediately. | |
| 289 void ReconfigureProfileSyncService(); | |
| 290 | |
| 291 // Reinitializing this Service means reloading the Sync settings. This method | |
| 292 // thereby ensures that changes in Sync settings take effect immediately. | |
|
Pam (message me for reviews)
2014/08/19 20:17:16
Duplicate comment
fhorschig
2014/08/20 11:59:30
Done.
| |
| 293 bool IncludesSyncSessions() const; | |
| 294 | |
| 295 // The option a custodian sets to either recored or prevent recording the | |
|
Pam (message me for reviews)
2014/08/19 20:17:16
TYpo: "record"
fhorschig
2014/08/20 11:59:30
Done.
| |
| 296 // supervised user's history. Set by |FetchNewSessionSyncState()| and | |
| 297 // defaults to true. | |
| 298 bool includes_session_sync_; | |
| 299 | |
| 275 // Owns us via the KeyedService mechanism. | 300 // Owns us via the KeyedService mechanism. |
| 276 Profile* profile_; | 301 Profile* profile_; |
| 277 | 302 |
| 278 bool active_; | 303 bool active_; |
| 279 | 304 |
| 280 Delegate* delegate_; | 305 Delegate* delegate_; |
| 281 | 306 |
| 282 #if defined(ENABLE_EXTENSIONS) | 307 #if defined(ENABLE_EXTENSIONS) |
| 283 ScopedObserver<extensions::ExtensionRegistry, | 308 ScopedObserver<extensions::ExtensionRegistry, |
| 284 extensions::ExtensionRegistryObserver> | 309 extensions::ExtensionRegistryObserver> |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 307 // Used to create permission requests. | 332 // Used to create permission requests. |
| 308 scoped_ptr<PermissionRequestCreator> permissions_creator_; | 333 scoped_ptr<PermissionRequestCreator> permissions_creator_; |
| 309 | 334 |
| 310 // True iff we are waiting for a permission request to be issued. | 335 // True iff we are waiting for a permission request to be issued. |
| 311 bool waiting_for_permissions_; | 336 bool waiting_for_permissions_; |
| 312 | 337 |
| 313 base::WeakPtrFactory<SupervisedUserService> weak_ptr_factory_; | 338 base::WeakPtrFactory<SupervisedUserService> weak_ptr_factory_; |
| 314 }; | 339 }; |
| 315 | 340 |
| 316 #endif // CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_SERVICE_H_ | 341 #endif // CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_SERVICE_H_ |
| OLD | NEW |