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_| and triggers reconfiguring the | |
280 // ProfileSyncService. | |
281 void OnHistoryRecordingStateChanged(); | |
282 | |
283 // Reads the state of |includes_sync_sessions_| from prefrences. The | |
Marc Treib
2014/08/20 14:14:26
Typo: preferences
fhorschig
2014/08/20 14:48:04
Done.
| |
284 // returned value indicates if |includes_sync_sessions_| has changed. | |
285 bool FetchNewSessionSyncState(); | |
286 | |
287 // Returns true if the syncer::SESSIONS should be included on Sync. | |
288 bool IncludesSyncSessions() const; | |
Marc Treib
2014/08/20 14:14:26
add "type" after SESSIONS
included IN sync
fhorschig
2014/08/20 14:48:03
Done.
| |
289 | |
290 // The option a custodian sets to either record or prevent recording the | |
291 // supervised user's history. Set by |FetchNewSessionSyncState()| and | |
292 // defaults to true. | |
293 bool includes_sync_sessions_; | |
294 | |
275 // Owns us via the KeyedService mechanism. | 295 // Owns us via the KeyedService mechanism. |
276 Profile* profile_; | 296 Profile* profile_; |
277 | 297 |
278 bool active_; | 298 bool active_; |
279 | 299 |
280 Delegate* delegate_; | 300 Delegate* delegate_; |
281 | 301 |
282 #if defined(ENABLE_EXTENSIONS) | 302 #if defined(ENABLE_EXTENSIONS) |
283 ScopedObserver<extensions::ExtensionRegistry, | 303 ScopedObserver<extensions::ExtensionRegistry, |
284 extensions::ExtensionRegistryObserver> | 304 extensions::ExtensionRegistryObserver> |
(...skipping 22 matching lines...) Expand all Loading... | |
307 // Used to create permission requests. | 327 // Used to create permission requests. |
308 scoped_ptr<PermissionRequestCreator> permissions_creator_; | 328 scoped_ptr<PermissionRequestCreator> permissions_creator_; |
309 | 329 |
310 // True iff we are waiting for a permission request to be issued. | 330 // True iff we are waiting for a permission request to be issued. |
311 bool waiting_for_permissions_; | 331 bool waiting_for_permissions_; |
312 | 332 |
313 base::WeakPtrFactory<SupervisedUserService> weak_ptr_factory_; | 333 base::WeakPtrFactory<SupervisedUserService> weak_ptr_factory_; |
314 }; | 334 }; |
315 | 335 |
316 #endif // CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_SERVICE_H_ | 336 #endif // CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_SERVICE_H_ |
OLD | NEW |