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> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/callback.h" | 13 #include "base/callback.h" |
14 #include "base/gtest_prod_util.h" | 14 #include "base/gtest_prod_util.h" |
15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
| 16 #include "base/observer_list.h" |
16 #include "base/prefs/pref_change_registrar.h" | 17 #include "base/prefs/pref_change_registrar.h" |
17 #include "base/scoped_observer.h" | 18 #include "base/scoped_observer.h" |
18 #include "base/strings/string16.h" | 19 #include "base/strings/string16.h" |
19 #include "chrome/browser/supervised_user/experimental/supervised_user_blacklist.
h" | 20 #include "chrome/browser/supervised_user/experimental/supervised_user_blacklist.
h" |
20 #include "chrome/browser/supervised_user/supervised_user_url_filter.h" | 21 #include "chrome/browser/supervised_user/supervised_user_url_filter.h" |
21 #include "chrome/browser/supervised_user/supervised_users.h" | 22 #include "chrome/browser/supervised_user/supervised_users.h" |
22 #include "chrome/browser/sync/profile_sync_service_observer.h" | 23 #include "chrome/browser/sync/profile_sync_service_observer.h" |
23 #include "chrome/browser/sync/sync_type_preference_provider.h" | 24 #include "chrome/browser/sync/sync_type_preference_provider.h" |
24 #include "chrome/browser/ui/browser_list_observer.h" | 25 #include "chrome/browser/ui/browser_list_observer.h" |
25 #include "components/keyed_service/core/keyed_service.h" | 26 #include "components/keyed_service/core/keyed_service.h" |
26 #include "content/public/browser/web_contents.h" | 27 #include "content/public/browser/web_contents.h" |
27 | 28 |
28 #if defined(ENABLE_EXTENSIONS) | 29 #if defined(ENABLE_EXTENSIONS) |
29 #include "extensions/browser/extension_registry_observer.h" | 30 #include "extensions/browser/extension_registry_observer.h" |
30 #include "extensions/browser/management_policy.h" | 31 #include "extensions/browser/management_policy.h" |
31 #endif | 32 #endif |
32 | 33 |
33 class Browser; | 34 class Browser; |
34 class GoogleServiceAuthError; | 35 class GoogleServiceAuthError; |
35 class PermissionRequestCreator; | 36 class PermissionRequestCreator; |
36 class Profile; | 37 class Profile; |
37 class SupervisedUserRegistrationUtility; | 38 class SupervisedUserRegistrationUtility; |
| 39 class SupervisedUserServiceObserver; |
38 class SupervisedUserSettingsService; | 40 class SupervisedUserSettingsService; |
39 class SupervisedUserSiteList; | 41 class SupervisedUserSiteList; |
40 class SupervisedUserURLFilter; | 42 class SupervisedUserURLFilter; |
41 | 43 |
42 namespace base { | 44 namespace base { |
43 class FilePath; | 45 class FilePath; |
44 } | 46 } |
45 | 47 |
46 namespace extensions { | 48 namespace extensions { |
47 class ExtensionRegistry; | 49 class ExtensionRegistry; |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 const std::string& supervised_user_id, | 161 const std::string& supervised_user_id, |
160 const AuthErrorCallback& callback); | 162 const AuthErrorCallback& callback); |
161 | 163 |
162 void set_elevated_for_testing(bool skip) { | 164 void set_elevated_for_testing(bool skip) { |
163 elevated_for_testing_ = skip; | 165 elevated_for_testing_ = skip; |
164 } | 166 } |
165 | 167 |
166 void AddNavigationBlockedCallback(const NavigationBlockedCallback& callback); | 168 void AddNavigationBlockedCallback(const NavigationBlockedCallback& callback); |
167 void DidBlockNavigation(content::WebContents* web_contents); | 169 void DidBlockNavigation(content::WebContents* web_contents); |
168 | 170 |
| 171 void AddObserver(SupervisedUserServiceObserver* observer); |
| 172 void RemoveObserver(SupervisedUserServiceObserver* observer); |
| 173 |
169 #if defined(ENABLE_EXTENSIONS) | 174 #if defined(ENABLE_EXTENSIONS) |
170 // extensions::ManagementPolicy::Provider implementation: | 175 // extensions::ManagementPolicy::Provider implementation: |
171 virtual std::string GetDebugPolicyProviderName() const OVERRIDE; | 176 virtual std::string GetDebugPolicyProviderName() const OVERRIDE; |
172 virtual bool UserMayLoad(const extensions::Extension* extension, | 177 virtual bool UserMayLoad(const extensions::Extension* extension, |
173 base::string16* error) const OVERRIDE; | 178 base::string16* error) const OVERRIDE; |
174 virtual bool UserMayModifySettings(const extensions::Extension* extension, | 179 virtual bool UserMayModifySettings(const extensions::Extension* extension, |
175 base::string16* error) const OVERRIDE; | 180 base::string16* error) const OVERRIDE; |
176 | 181 |
177 // extensions::ExtensionRegistryObserver implementation. | 182 // extensions::ExtensionRegistryObserver implementation. |
178 virtual void OnExtensionLoaded( | 183 virtual void OnExtensionLoaded( |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 bool did_init_; | 324 bool did_init_; |
320 | 325 |
321 // True only when |Shutdown()| method has been called. | 326 // True only when |Shutdown()| method has been called. |
322 bool did_shutdown_; | 327 bool did_shutdown_; |
323 | 328 |
324 URLFilterContext url_filter_context_; | 329 URLFilterContext url_filter_context_; |
325 | 330 |
326 // Used to create permission requests. | 331 // Used to create permission requests. |
327 scoped_ptr<PermissionRequestCreator> permissions_creator_; | 332 scoped_ptr<PermissionRequestCreator> permissions_creator_; |
328 | 333 |
| 334 ObserverList<SupervisedUserServiceObserver> observer_list_; |
| 335 |
329 base::WeakPtrFactory<SupervisedUserService> weak_ptr_factory_; | 336 base::WeakPtrFactory<SupervisedUserService> weak_ptr_factory_; |
330 }; | 337 }; |
331 | 338 |
332 #endif // CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_SERVICE_H_ | 339 #endif // CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_SERVICE_H_ |
OLD | NEW |