| 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 <set> | 8 #include <set> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 #include "content/public/browser/notification_registrar.h" | 21 #include "content/public/browser/notification_registrar.h" |
| 22 #include "content/public/browser/web_contents.h" | 22 #include "content/public/browser/web_contents.h" |
| 23 #include "extensions/browser/management_policy.h" | 23 #include "extensions/browser/management_policy.h" |
| 24 | 24 |
| 25 class Browser; | 25 class Browser; |
| 26 class GoogleServiceAuthError; | 26 class GoogleServiceAuthError; |
| 27 class ManagedModeURLFilter; | 27 class ManagedModeURLFilter; |
| 28 class ManagedModeSiteList; | 28 class ManagedModeSiteList; |
| 29 class ManagedUserRegistrationUtility; | 29 class ManagedUserRegistrationUtility; |
| 30 class ManagedUserSettingsService; | 30 class ManagedUserSettingsService; |
| 31 class PermissionRequestCreator; |
| 31 class Profile; | 32 class Profile; |
| 32 | 33 |
| 33 namespace user_prefs { | 34 namespace user_prefs { |
| 34 class PrefRegistrySyncable; | 35 class PrefRegistrySyncable; |
| 35 } | 36 } |
| 36 | 37 |
| 37 // This class handles all the information related to a given managed profile | 38 // This class handles all the information related to a given managed profile |
| 38 // (e.g. the installed content packs, the default URL filtering behavior, or | 39 // (e.g. the installed content packs, the default URL filtering behavior, or |
| 39 // manual whitelist/blacklist overrides). | 40 // manual whitelist/blacklist overrides). |
| 40 class ManagedUserService : public KeyedService, | 41 class ManagedUserService : public KeyedService, |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 int GetCategory(const GURL& url); | 75 int GetCategory(const GURL& url); |
| 75 | 76 |
| 76 // Returns the list of all known human-readable category names, sorted by ID | 77 // Returns the list of all known human-readable category names, sorted by ID |
| 77 // number. Called in the critical path of drawing the history UI, so needs to | 78 // number. Called in the critical path of drawing the history UI, so needs to |
| 78 // be fast. | 79 // be fast. |
| 79 void GetCategoryNames(CategoryList* list); | 80 void GetCategoryNames(CategoryList* list); |
| 80 | 81 |
| 81 // Whether the user can request access to blocked URLs. | 82 // Whether the user can request access to blocked URLs. |
| 82 bool AccessRequestsEnabled(); | 83 bool AccessRequestsEnabled(); |
| 83 | 84 |
| 85 void OnPermissionRequestIssued(const GoogleServiceAuthError& error); |
| 86 |
| 84 // Adds an access request for the given URL. The requests are stored using | 87 // Adds an access request for the given URL. The requests are stored using |
| 85 // a prefix followed by a URIEncoded version of the URL. Each entry contains | 88 // a prefix followed by a URIEncoded version of the URL. Each entry contains |
| 86 // a dictionary which currently has the timestamp of the request in it. | 89 // a dictionary which currently has the timestamp of the request in it. |
| 87 void AddAccessRequest(const GURL& url); | 90 void AddAccessRequest(const GURL& url); |
| 88 | 91 |
| 89 // Returns the email address of the custodian. | 92 // Returns the email address of the custodian. |
| 90 std::string GetCustodianEmailAddress() const; | 93 std::string GetCustodianEmailAddress() const; |
| 91 | 94 |
| 92 // Returns the name of the custodian, or the email address if the name is | 95 // Returns the name of the custodian, or the email address if the name is |
| 93 // empty. | 96 // empty. |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 std::vector<NavigationBlockedCallback> navigation_blocked_callbacks_; | 240 std::vector<NavigationBlockedCallback> navigation_blocked_callbacks_; |
| 238 | 241 |
| 239 // Sets a profile in elevated state for testing if set to true. | 242 // Sets a profile in elevated state for testing if set to true. |
| 240 bool elevated_for_testing_; | 243 bool elevated_for_testing_; |
| 241 | 244 |
| 242 // True only when |Shutdown()| method has been called. | 245 // True only when |Shutdown()| method has been called. |
| 243 bool did_shutdown_; | 246 bool did_shutdown_; |
| 244 | 247 |
| 245 URLFilterContext url_filter_context_; | 248 URLFilterContext url_filter_context_; |
| 246 | 249 |
| 250 // Used to create permission requests. |
| 251 scoped_ptr<PermissionRequestCreator> permissions_creator_; |
| 252 |
| 253 // True iff we are waiting for a permission request to be issued. |
| 254 bool waiting_for_permissions_; |
| 255 |
| 247 base::WeakPtrFactory<ManagedUserService> weak_ptr_factory_; | 256 base::WeakPtrFactory<ManagedUserService> weak_ptr_factory_; |
| 248 }; | 257 }; |
| 249 | 258 |
| 250 #endif // CHROME_BROWSER_MANAGED_MODE_MANAGED_USER_SERVICE_H_ | 259 #endif // CHROME_BROWSER_MANAGED_MODE_MANAGED_USER_SERVICE_H_ |
| OLD | NEW |