| 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 <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 // ProfileSyncServiceObserver implementation: | 199 // ProfileSyncServiceObserver implementation: |
| 200 virtual void OnStateChanged() OVERRIDE; | 200 virtual void OnStateChanged() OVERRIDE; |
| 201 | 201 |
| 202 // chrome::BrowserListObserver implementation: | 202 // chrome::BrowserListObserver implementation: |
| 203 virtual void OnBrowserSetLastActive(Browser* browser) OVERRIDE; | 203 virtual void OnBrowserSetLastActive(Browser* browser) OVERRIDE; |
| 204 | 204 |
| 205 private: | 205 private: |
| 206 friend class SupervisedUserServiceExtensionTestBase; | 206 friend class SupervisedUserServiceExtensionTestBase; |
| 207 friend class SupervisedUserServiceFactory; | 207 friend class SupervisedUserServiceFactory; |
| 208 FRIEND_TEST_ALL_PREFIXES(SupervisedUserServiceTest, ClearOmitOnRegistration); | 208 FRIEND_TEST_ALL_PREFIXES(SupervisedUserServiceTest, ClearOmitOnRegistration); |
| 209 | 209 FRIEND_TEST_ALL_PREFIXES(SupervisedUserServiceTest, |
| 210 ChangesIncludedSessionOnChangedSettings); |
| 211 FRIEND_TEST_ALL_PREFIXES(SupervisedUserServiceTest, |
| 212 ChangesSyncSessionStateOnChangedSettings); |
| 210 // A bridge from the UI thread to the SupervisedUserURLFilters, one of which | 213 // A bridge from the UI thread to the SupervisedUserURLFilters, one of which |
| 211 // lives on the IO thread. This class mediates access to them and makes sure | 214 // lives on the IO thread. This class mediates access to them and makes sure |
| 212 // they are kept in sync. | 215 // they are kept in sync. |
| 213 class URLFilterContext { | 216 class URLFilterContext { |
| 214 public: | 217 public: |
| 215 URLFilterContext(); | 218 URLFilterContext(); |
| 216 ~URLFilterContext(); | 219 ~URLFilterContext(); |
| 217 | 220 |
| 218 SupervisedUserURLFilter* ui_url_filter() const; | 221 SupervisedUserURLFilter* ui_url_filter() const; |
| 219 SupervisedUserURLFilter* io_url_filter() const; | 222 SupervisedUserURLFilter* io_url_filter() const; |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 // corresponding preference is changed. | 305 // corresponding preference is changed. |
| 303 void UpdateManualHosts(); | 306 void UpdateManualHosts(); |
| 304 | 307 |
| 305 // Updates the manual overrides for URLs in the URL filters when the | 308 // Updates the manual overrides for URLs in the URL filters when the |
| 306 // corresponding preference is changed. | 309 // corresponding preference is changed. |
| 307 void UpdateManualURLs(); | 310 void UpdateManualURLs(); |
| 308 | 311 |
| 309 // Returns the human readable name of the supervised user. | 312 // Returns the human readable name of the supervised user. |
| 310 std::string GetSupervisedUserName() const; | 313 std::string GetSupervisedUserName() const; |
| 311 | 314 |
| 315 // Subscribes to the SupervisedUserPrefStore, refreshes |
| 316 // |includes_sync_sessions_type_| and triggers reconfiguring the |
| 317 // ProfileSyncService. |
| 318 void OnHistoryRecordingStateChanged(); |
| 319 |
| 320 // Returns true if the syncer::SESSIONS type should be included in Sync. |
| 321 bool IncludesSyncSessionsType() const; |
| 322 |
| 323 // The option a custodian sets to either record or prevent recording the |
| 324 // supervised user's history. Set by |FetchNewSessionSyncState()| and |
| 325 // defaults to true. |
| 326 bool includes_sync_sessions_type_; |
| 327 |
| 312 // Owns us via the KeyedService mechanism. | 328 // Owns us via the KeyedService mechanism. |
| 313 Profile* profile_; | 329 Profile* profile_; |
| 314 | 330 |
| 315 bool active_; | 331 bool active_; |
| 316 | 332 |
| 317 Delegate* delegate_; | 333 Delegate* delegate_; |
| 318 | 334 |
| 319 #if defined(ENABLE_EXTENSIONS) | 335 #if defined(ENABLE_EXTENSIONS) |
| 320 ScopedObserver<extensions::ExtensionRegistry, | 336 ScopedObserver<extensions::ExtensionRegistry, |
| 321 extensions::ExtensionRegistryObserver> | 337 extensions::ExtensionRegistryObserver> |
| (...skipping 22 matching lines...) Expand all Loading... |
| 344 | 360 |
| 345 // Used to create permission requests. | 361 // Used to create permission requests. |
| 346 scoped_ptr<PermissionRequestCreator> permissions_creator_; | 362 scoped_ptr<PermissionRequestCreator> permissions_creator_; |
| 347 | 363 |
| 348 ObserverList<SupervisedUserServiceObserver> observer_list_; | 364 ObserverList<SupervisedUserServiceObserver> observer_list_; |
| 349 | 365 |
| 350 base::WeakPtrFactory<SupervisedUserService> weak_ptr_factory_; | 366 base::WeakPtrFactory<SupervisedUserService> weak_ptr_factory_; |
| 351 }; | 367 }; |
| 352 | 368 |
| 353 #endif // CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_SERVICE_H_ | 369 #endif // CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_SERVICE_H_ |
| OLD | NEW |