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 // Subscribes to the SupervisedUserPrefStore, refreshes |
| 279 // |includes_sync_sessions_type_| and triggers reconfiguring the |
| 280 // ProfileSyncService. |
| 281 void OnHistoryRecordingStateChanged(); |
| 282 |
| 283 // Returns true if the syncer::SESSIONS type should be included in Sync. |
| 284 bool IncludesSyncSessionsType() const; |
| 285 |
| 286 // The option a custodian sets to either record or prevent recording the |
| 287 // supervised user's history. Set by |FetchNewSessionSyncState()| and |
| 288 // defaults to true. |
| 289 bool includes_sync_sessions_type_; |
| 290 |
275 // Owns us via the KeyedService mechanism. | 291 // Owns us via the KeyedService mechanism. |
276 Profile* profile_; | 292 Profile* profile_; |
277 | 293 |
278 bool active_; | 294 bool active_; |
279 | 295 |
280 Delegate* delegate_; | 296 Delegate* delegate_; |
281 | 297 |
282 #if defined(ENABLE_EXTENSIONS) | 298 #if defined(ENABLE_EXTENSIONS) |
283 ScopedObserver<extensions::ExtensionRegistry, | 299 ScopedObserver<extensions::ExtensionRegistry, |
284 extensions::ExtensionRegistryObserver> | 300 extensions::ExtensionRegistryObserver> |
(...skipping 22 matching lines...) Expand all Loading... |
307 // Used to create permission requests. | 323 // Used to create permission requests. |
308 scoped_ptr<PermissionRequestCreator> permissions_creator_; | 324 scoped_ptr<PermissionRequestCreator> permissions_creator_; |
309 | 325 |
310 // True iff we are waiting for a permission request to be issued. | 326 // True iff we are waiting for a permission request to be issued. |
311 bool waiting_for_permissions_; | 327 bool waiting_for_permissions_; |
312 | 328 |
313 base::WeakPtrFactory<SupervisedUserService> weak_ptr_factory_; | 329 base::WeakPtrFactory<SupervisedUserService> weak_ptr_factory_; |
314 }; | 330 }; |
315 | 331 |
316 #endif // CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_SERVICE_H_ | 332 #endif // CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_SERVICE_H_ |
OLD | NEW |