| 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 explicit ManagedUserService(Profile* profile); | 32 explicit ManagedUserService(Profile* profile); |
| 33 virtual ~ManagedUserService(); | 33 virtual ~ManagedUserService(); |
| 34 | 34 |
| 35 bool ProfileIsManaged() const; | 35 bool ProfileIsManaged() const; |
| 36 | 36 |
| 37 static void RegisterUserPrefs(PrefServiceSyncable* prefs); | 37 static void RegisterUserPrefs(PrefRegistrySyncable* registry); |
| 38 | 38 |
| 39 // Returns the URL filter for the IO thread, for filtering network requests | 39 // Returns the URL filter for the IO thread, for filtering network requests |
| 40 // (in ManagedModeResourceThrottle). | 40 // (in ManagedModeResourceThrottle). |
| 41 scoped_refptr<const ManagedModeURLFilter> GetURLFilterForIOThread(); | 41 scoped_refptr<const ManagedModeURLFilter> GetURLFilterForIOThread(); |
| 42 | 42 |
| 43 // Returns the URL filter for the UI thread, for filtering navigations and | 43 // Returns the URL filter for the UI thread, for filtering navigations and |
| 44 // classifying sites in the history view. | 44 // classifying sites in the history view. |
| 45 ManagedModeURLFilter* GetURLFilterForUIThread(); | 45 ManagedModeURLFilter* GetURLFilterForUIThread(); |
| 46 | 46 |
| 47 // Returns the URL's category, obtained from the installed content packs. | 47 // Returns the URL's category, obtained from the installed content packs. |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 // example). | 162 // example). |
| 163 bool is_elevated_; | 163 bool is_elevated_; |
| 164 | 164 |
| 165 content::NotificationRegistrar registrar_; | 165 content::NotificationRegistrar registrar_; |
| 166 PrefChangeRegistrar pref_change_registrar_; | 166 PrefChangeRegistrar pref_change_registrar_; |
| 167 | 167 |
| 168 URLFilterContext url_filter_context_; | 168 URLFilterContext url_filter_context_; |
| 169 }; | 169 }; |
| 170 | 170 |
| 171 #endif // CHROME_BROWSER_MANAGED_MODE_MANAGED_USER_SERVICE_H_ | 171 #endif // CHROME_BROWSER_MANAGED_MODE_MANAGED_USER_SERVICE_H_ |
| OLD | NEW |