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 ChangesSessionSyncOnChangedSettings); | |
| 191 // A bridge from the UI thread to the SupervisedUserURLFilters, one of which | 192 // 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 | 193 // lives on the IO thread. This class mediates access to them and makes sure |
| 193 // they are kept in sync. | 194 // they are kept in sync. |
| 194 class URLFilterContext { | 195 class URLFilterContext { |
| 195 public: | 196 public: |
| 196 URLFilterContext(); | 197 URLFilterContext(); |
| 197 ~URLFilterContext(); | 198 ~URLFilterContext(); |
| 198 | 199 |
| 199 SupervisedUserURLFilter* ui_url_filter() const; | 200 SupervisedUserURLFilter* ui_url_filter() const; |
| 200 SupervisedUserURLFilter* io_url_filter() const; | 201 SupervisedUserURLFilter* io_url_filter() const; |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 265 // corresponding preference is changed. | 266 // corresponding preference is changed. |
| 266 void UpdateManualHosts(); | 267 void UpdateManualHosts(); |
| 267 | 268 |
| 268 // Updates the manual overrides for URLs in the URL filters when the | 269 // Updates the manual overrides for URLs in the URL filters when the |
| 269 // corresponding preference is changed. | 270 // corresponding preference is changed. |
| 270 void UpdateManualURLs(); | 271 void UpdateManualURLs(); |
| 271 | 272 |
| 272 // Returns the human readable name of the supervised user. | 273 // Returns the human readable name of the supervised user. |
| 273 std::string GetSupervisedUserName() const; | 274 std::string GetSupervisedUserName() const; |
| 274 | 275 |
| 276 // Gets attached to the SupervisedUserSettingsService and writes into | |
| 277 // may_session_sync_ if the history may be recorded. | |
| 278 void OnNewSettingsAvailable(const base::DictionaryValue* settings); | |
| 279 | |
| 280 // Reads the state of |may_session_sync_| from given SU settings. The returned | |
| 281 // value indicates if |may_session_sync_| has changed. | |
| 282 bool FetchNewSessionSyncState(const base::DictionaryValue* settings); | |
| 283 | |
| 284 // Reinitializing this Service means reloading the Sync settings. This method | |
| 285 // thereby ensures that changes in Sync settings take effect immediately. | |
| 286 void ReinitializeProfileSyncService(); | |
|
Marc Treib
2014/08/19 14:00:27
Reconfigure?
| |
| 287 | |
| 288 // Reinitializing this Service means reloading the Sync settings. This method | |
| 289 // thereby ensures that changes in Sync settings take effect immediately. | |
| 290 bool MaySyncSessions() const; | |
|
Marc Treib
2014/08/19 14:00:28
"May" isn't the right word here, since the SU does
| |
| 291 | |
| 292 // The option a custodian sets to either recored or prevent recording the | |
| 293 // supervised user's history. Set by |FetchNewSessionSyncState()| and | |
| 294 // Defaults to true; | |
|
Marc Treib
2014/08/19 14:00:28
nit: don't capitalize "Defaults"; end with "."
| |
| 295 bool may_session_sync_; | |
| 296 | |
| 275 // Owns us via the KeyedService mechanism. | 297 // Owns us via the KeyedService mechanism. |
| 276 Profile* profile_; | 298 Profile* profile_; |
| 277 | 299 |
| 278 bool active_; | 300 bool active_; |
| 279 | 301 |
| 280 Delegate* delegate_; | 302 Delegate* delegate_; |
| 281 | 303 |
| 282 #if defined(ENABLE_EXTENSIONS) | 304 #if defined(ENABLE_EXTENSIONS) |
| 283 ScopedObserver<extensions::ExtensionRegistry, | 305 ScopedObserver<extensions::ExtensionRegistry, |
| 284 extensions::ExtensionRegistryObserver> | 306 extensions::ExtensionRegistryObserver> |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 307 // Used to create permission requests. | 329 // Used to create permission requests. |
| 308 scoped_ptr<PermissionRequestCreator> permissions_creator_; | 330 scoped_ptr<PermissionRequestCreator> permissions_creator_; |
| 309 | 331 |
| 310 // True iff we are waiting for a permission request to be issued. | 332 // True iff we are waiting for a permission request to be issued. |
| 311 bool waiting_for_permissions_; | 333 bool waiting_for_permissions_; |
| 312 | 334 |
| 313 base::WeakPtrFactory<SupervisedUserService> weak_ptr_factory_; | 335 base::WeakPtrFactory<SupervisedUserService> weak_ptr_factory_; |
| 314 }; | 336 }; |
| 315 | 337 |
| 316 #endif // CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_SERVICE_H_ | 338 #endif // CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_SERVICE_H_ |
| OLD | NEW |