| 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 COMPONENTS_SIGNIN_CORE_BROWSER_SIGNIN_CLIENT_H_ | 5 #ifndef COMPONENTS_SIGNIN_CORE_BROWSER_SIGNIN_CLIENT_H_ |
| 6 #define COMPONENTS_SIGNIN_CORE_BROWSER_SIGNIN_CLIENT_H_ | 6 #define COMPONENTS_SIGNIN_CORE_BROWSER_SIGNIN_CLIENT_H_ |
| 7 | 7 |
| 8 #include <memory> |
| 9 |
| 8 #include "base/callback.h" | 10 #include "base/callback.h" |
| 9 #include "base/callback_list.h" | 11 #include "base/callback_list.h" |
| 10 #include "base/time/time.h" | 12 #include "base/time/time.h" |
| 11 #include "components/keyed_service/core/keyed_service.h" | 13 #include "components/keyed_service/core/keyed_service.h" |
| 12 #include "components/signin/core/browser/account_info.h" | 14 #include "components/signin/core/browser/account_info.h" |
| 13 #include "components/signin/core/browser/webdata/token_web_data.h" | 15 #include "components/signin/core/browser/webdata/token_web_data.h" |
| 14 #include "google_apis/gaia/gaia_auth_fetcher.h" | 16 #include "google_apis/gaia/gaia_auth_fetcher.h" |
| 15 #include "net/cookies/cookie_store.h" | 17 #include "net/cookies/cookie_store.h" |
| 16 #include "url/gurl.h" | 18 #include "url/gurl.h" |
| 17 | 19 |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 // Adds an observer to listen for changes to the state of sign in cookie | 111 // Adds an observer to listen for changes to the state of sign in cookie |
| 110 // settings. | 112 // settings. |
| 111 virtual void AddContentSettingsObserver( | 113 virtual void AddContentSettingsObserver( |
| 112 content_settings::Observer* observer) = 0; | 114 content_settings::Observer* observer) = 0; |
| 113 virtual void RemoveContentSettingsObserver( | 115 virtual void RemoveContentSettingsObserver( |
| 114 content_settings::Observer* observer) = 0; | 116 content_settings::Observer* observer) = 0; |
| 115 | 117 |
| 116 // Execute |callback| if and when there is a network connection. | 118 // Execute |callback| if and when there is a network connection. |
| 117 virtual void DelayNetworkCall(const base::Closure& callback) = 0; | 119 virtual void DelayNetworkCall(const base::Closure& callback) = 0; |
| 118 | 120 |
| 119 // Creates and returns a new platform-specific GaiaAuthFetcher. It is the | 121 // Creates a new platform-specific GaiaAuthFetcher. |
| 120 // responsability of the caller to delete the returned object. | 122 virtual std::unique_ptr<GaiaAuthFetcher> CreateGaiaAuthFetcher( |
| 121 virtual GaiaAuthFetcher* CreateGaiaAuthFetcher( | |
| 122 GaiaAuthConsumer* consumer, | 123 GaiaAuthConsumer* consumer, |
| 123 const std::string& source, | 124 const std::string& source, |
| 124 net::URLRequestContextGetter* getter) = 0; | 125 net::URLRequestContextGetter* getter) = 0; |
| 125 | 126 |
| 126 // Called once the credentials has been copied to another SigninManager. | 127 // Called once the credentials has been copied to another SigninManager. |
| 127 virtual void AfterCredentialsCopied() {} | 128 virtual void AfterCredentialsCopied() {} |
| 128 | 129 |
| 129 protected: | 130 protected: |
| 130 // Returns device id that is scoped to single signin. | 131 // Returns device id that is scoped to single signin. |
| 131 // Stores the ID in the kGoogleServicesSigninScopedDeviceId pref. | 132 // Stores the ID in the kGoogleServicesSigninScopedDeviceId pref. |
| 132 std::string GetOrCreateScopedDeviceIdPref(PrefService* prefs); | 133 std::string GetOrCreateScopedDeviceIdPref(PrefService* prefs); |
| 133 | 134 |
| 134 private: | 135 private: |
| 135 // Perform Chrome-specific sign out. This happens when user signs out or about | 136 // Perform Chrome-specific sign out. This happens when user signs out or about |
| 136 // to sign in. | 137 // to sign in. |
| 137 // This method should not be called from the outside of SigninClient. External | 138 // This method should not be called from the outside of SigninClient. External |
| 138 // callers must use SignOut() instead. | 139 // callers must use SignOut() instead. |
| 139 virtual void OnSignedOut() = 0; | 140 virtual void OnSignedOut() = 0; |
| 140 }; | 141 }; |
| 141 | 142 |
| 142 #endif // COMPONENTS_SIGNIN_CORE_BROWSER_SIGNIN_CLIENT_H_ | 143 #endif // COMPONENTS_SIGNIN_CORE_BROWSER_SIGNIN_CLIENT_H_ |
| OLD | NEW |