OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_MANAGED_MODE_MANAGED_USER_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_MANAGED_MODE_MANAGED_USER_SERVICE_H_ |
6 #define CHROME_BROWSER_MANAGED_MODE_MANAGED_USER_SERVICE_H_ | 6 #define CHROME_BROWSER_MANAGED_MODE_MANAGED_USER_SERVICE_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/prefs/public/pref_change_registrar.h" | 10 #include "base/prefs/public/pref_change_registrar.h" |
11 #include "base/string16.h" | 11 #include "base/string16.h" |
12 #include "chrome/browser/extensions/management_policy.h" | 12 #include "chrome/browser/extensions/management_policy.h" |
13 #include "chrome/browser/managed_mode/managed_mode_url_filter.h" | 13 #include "chrome/browser/managed_mode/managed_mode_url_filter.h" |
14 #include "chrome/browser/profiles/profile_keyed_service.h" | 14 #include "chrome/browser/profiles/profile_keyed_service.h" |
15 #include "content/public/browser/notification_observer.h" | 15 #include "content/public/browser/notification_observer.h" |
16 #include "content/public/browser/notification_registrar.h" | 16 #include "content/public/browser/notification_registrar.h" |
17 | 17 |
18 class ManagedModeURLFilter; | 18 class ManagedModeURLFilter; |
19 class ManagedModeSiteList; | 19 class ManagedModeSiteList; |
20 class PrefServiceSyncable; | 20 class PrefRegistrySyncable; |
21 class Profile; | 21 class Profile; |
22 | 22 |
23 // This class handles all the information related to a given managed profile | 23 // This class handles all the information related to a given managed profile |
24 // (e.g. the installed content packs, the default URL filtering behavior, or | 24 // (e.g. the installed content packs, the default URL filtering behavior, or |
25 // manual whitelist/blacklist overrides). | 25 // manual whitelist/blacklist overrides). |
26 class ManagedUserService : public ProfileKeyedService, | 26 class ManagedUserService : public ProfileKeyedService, |
27 public extensions::ManagementPolicy::Provider, | 27 public extensions::ManagementPolicy::Provider, |
28 public content::NotificationObserver { | 28 public content::NotificationObserver { |
29 public: | 29 public: |
30 typedef std::vector<string16> CategoryList; | 30 typedef std::vector<string16> CategoryList; |
31 | 31 |
32 enum ManualBehavior { | 32 enum ManualBehavior { |
33 MANUAL_NONE = 0, | 33 MANUAL_NONE = 0, |
34 MANUAL_ALLOW, | 34 MANUAL_ALLOW, |
35 MANUAL_BLOCK | 35 MANUAL_BLOCK |
36 }; | 36 }; |
37 | 37 |
38 explicit ManagedUserService(Profile* profile); | 38 explicit ManagedUserService(Profile* profile); |
39 virtual ~ManagedUserService(); | 39 virtual ~ManagedUserService(); |
40 | 40 |
41 bool ProfileIsManaged() const; | 41 bool ProfileIsManaged() const; |
42 | 42 |
43 static void RegisterUserPrefs(PrefServiceSyncable* prefs); | 43 static void RegisterUserPrefs(PrefRegistrySyncable* registry); |
44 | 44 |
45 // Returns the URL filter for the IO thread, for filtering network requests | 45 // Returns the URL filter for the IO thread, for filtering network requests |
46 // (in ManagedModeResourceThrottle). | 46 // (in ManagedModeResourceThrottle). |
47 scoped_refptr<const ManagedModeURLFilter> GetURLFilterForIOThread(); | 47 scoped_refptr<const ManagedModeURLFilter> GetURLFilterForIOThread(); |
48 | 48 |
49 // Returns the URL filter for the UI thread, for filtering navigations and | 49 // Returns the URL filter for the UI thread, for filtering navigations and |
50 // classifying sites in the history view. | 50 // classifying sites in the history view. |
51 ManagedModeURLFilter* GetURLFilterForUIThread(); | 51 ManagedModeURLFilter* GetURLFilterForUIThread(); |
52 | 52 |
53 // Returns the URL's category, obtained from the installed content packs. | 53 // Returns the URL's category, obtained from the installed content packs. |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 // example). | 158 // example). |
159 bool is_elevated_; | 159 bool is_elevated_; |
160 | 160 |
161 content::NotificationRegistrar registrar_; | 161 content::NotificationRegistrar registrar_; |
162 PrefChangeRegistrar pref_change_registrar_; | 162 PrefChangeRegistrar pref_change_registrar_; |
163 | 163 |
164 URLFilterContext url_filter_context_; | 164 URLFilterContext url_filter_context_; |
165 }; | 165 }; |
166 | 166 |
167 #endif // CHROME_BROWSER_MANAGED_MODE_MANAGED_USER_SERVICE_H_ | 167 #endif // CHROME_BROWSER_MANAGED_MODE_MANAGED_USER_SERVICE_H_ |
OLD | NEW |