| 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 <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 typedef base::Callback<void(content::WebContents*)> NavigationBlockedCallback; | 76 typedef base::Callback<void(content::WebContents*)> NavigationBlockedCallback; |
| 77 typedef base::Callback<void(const GoogleServiceAuthError&)> AuthErrorCallback; | 77 typedef base::Callback<void(const GoogleServiceAuthError&)> AuthErrorCallback; |
| 78 typedef base::Callback<void(bool)> SuccessCallback; | 78 typedef base::Callback<void(bool)> SuccessCallback; |
| 79 | 79 |
| 80 class Delegate { | 80 class Delegate { |
| 81 public: | 81 public: |
| 82 virtual ~Delegate() {} | 82 virtual ~Delegate() {} |
| 83 // Returns true to indicate that the delegate handled the (de)activation, or | 83 // Returns true to indicate that the delegate handled the (de)activation, or |
| 84 // false to indicate that the SupervisedUserService itself should handle it. | 84 // false to indicate that the SupervisedUserService itself should handle it. |
| 85 virtual bool SetActive(bool active) = 0; | 85 virtual bool SetActive(bool active) = 0; |
| 86 // Returns whether the current profile is linked to a child account. |
| 87 virtual bool IsChildAccount() const; |
| 86 // Returns the path to a blacklist file to load, or an empty path to | 88 // Returns the path to a blacklist file to load, or an empty path to |
| 87 // indicate "none". | 89 // indicate "none". |
| 88 virtual base::FilePath GetBlacklistPath() const; | 90 virtual base::FilePath GetBlacklistPath() const; |
| 89 // Returns the URL from which to download a blacklist if no local one exists | 91 // Returns the URL from which to download a blacklist if no local one exists |
| 90 // yet. The blacklist file will be stored at |GetBlacklistPath()|. | 92 // yet. The blacklist file will be stored at |GetBlacklistPath()|. |
| 91 virtual GURL GetBlacklistURL() const; | 93 virtual GURL GetBlacklistURL() const; |
| 92 // Returns the identifier ("cx") of the Custom Search Engine to use for the | 94 // Returns the identifier ("cx") of the Custom Search Engine to use for the |
| 93 // experimental "SafeSites" feature, or the empty string to disable the | 95 // experimental "SafeSites" feature, or the empty string to disable the |
| 94 // feature. | 96 // feature. |
| 95 virtual std::string GetSafeSitesCx() const; | 97 virtual std::string GetSafeSitesCx() const; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 121 void GetCategoryNames(CategoryList* list); | 123 void GetCategoryNames(CategoryList* list); |
| 122 | 124 |
| 123 // Whether the user can request access to blocked URLs. | 125 // Whether the user can request access to blocked URLs. |
| 124 bool AccessRequestsEnabled(); | 126 bool AccessRequestsEnabled(); |
| 125 | 127 |
| 126 // Adds an access request for the given URL. The requests are stored using | 128 // Adds an access request for the given URL. The requests are stored using |
| 127 // a prefix followed by a URIEncoded version of the URL. Each entry contains | 129 // a prefix followed by a URIEncoded version of the URL. Each entry contains |
| 128 // a dictionary which currently has the timestamp of the request in it. | 130 // a dictionary which currently has the timestamp of the request in it. |
| 129 void AddAccessRequest(const GURL& url, const SuccessCallback& callback); | 131 void AddAccessRequest(const GURL& url, const SuccessCallback& callback); |
| 130 | 132 |
| 133 // Returns whether the profile is linked to a child account. |
| 134 bool IsChildAccount() const; |
| 135 |
| 131 // Returns the email address of the custodian. | 136 // Returns the email address of the custodian. |
| 132 std::string GetCustodianEmailAddress() const; | 137 std::string GetCustodianEmailAddress() const; |
| 133 | 138 |
| 134 // Returns the name of the custodian, or the email address if the name is | 139 // Returns the name of the custodian, or the email address if the name is |
| 135 // empty. | 140 // empty. |
| 136 std::string GetCustodianName() const; | 141 std::string GetCustodianName() const; |
| 137 | 142 |
| 138 // Returns the email address of the second custodian, or the empty string | 143 // Returns the email address of the second custodian, or the empty string |
| 139 // if there is no second custodian. | 144 // if there is no second custodian. |
| 140 std::string GetSecondCustodianEmailAddress() const; | 145 std::string GetSecondCustodianEmailAddress() const; |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 372 | 377 |
| 373 // Used to create permission requests. | 378 // Used to create permission requests. |
| 374 ScopedVector<PermissionRequestCreator> permissions_creators_; | 379 ScopedVector<PermissionRequestCreator> permissions_creators_; |
| 375 | 380 |
| 376 ObserverList<SupervisedUserServiceObserver> observer_list_; | 381 ObserverList<SupervisedUserServiceObserver> observer_list_; |
| 377 | 382 |
| 378 base::WeakPtrFactory<SupervisedUserService> weak_ptr_factory_; | 383 base::WeakPtrFactory<SupervisedUserService> weak_ptr_factory_; |
| 379 }; | 384 }; |
| 380 | 385 |
| 381 #endif // CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_SERVICE_H_ | 386 #endif // CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_SERVICE_H_ |
| OLD | NEW |