OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 IOS_CHROME_BROWSER_SIGNIN_SIGNIN_CLIENT_IMPL_H_ | 5 #ifndef IOS_CHROME_BROWSER_SIGNIN_SIGNIN_CLIENT_IMPL_H_ |
6 #define IOS_CHROME_BROWSER_SIGNIN_SIGNIN_CLIENT_IMPL_H_ | 6 #define IOS_CHROME_BROWSER_SIGNIN_SIGNIN_CLIENT_IMPL_H_ |
7 | 7 |
| 8 #include <memory> |
| 9 |
8 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
9 #include "base/macros.h" | 11 #include "base/macros.h" |
10 #include "base/memory/scoped_ptr.h" | |
11 #include "components/signin/core/browser/signin_client.h" | 12 #include "components/signin/core/browser/signin_client.h" |
12 #include "components/signin/core/browser/signin_error_controller.h" | 13 #include "components/signin/core/browser/signin_error_controller.h" |
13 #include "google_apis/gaia/gaia_oauth_client.h" | 14 #include "google_apis/gaia/gaia_oauth_client.h" |
14 #include "google_apis/gaia/oauth2_token_service.h" | 15 #include "google_apis/gaia/oauth2_token_service.h" |
15 #include "net/base/network_change_notifier.h" | 16 #include "net/base/network_change_notifier.h" |
16 | 17 |
17 namespace content_settings { | 18 namespace content_settings { |
18 class CookieSettings; | 19 class CookieSettings; |
19 } | 20 } |
20 | 21 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 const std::string& source, | 63 const std::string& source, |
63 net::URLRequestContextGetter* getter) override; | 64 net::URLRequestContextGetter* getter) override; |
64 | 65 |
65 // KeyedService implementation. | 66 // KeyedService implementation. |
66 void Shutdown() override; | 67 void Shutdown() override; |
67 | 68 |
68 // Returns a string describing the chrome version environment. Version format: | 69 // Returns a string describing the chrome version environment. Version format: |
69 // <Build Info> <OS> <Version number> (<Last change>)<channel or "-devel"> | 70 // <Build Info> <OS> <Version number> (<Last change>)<channel or "-devel"> |
70 // If version information is unavailable, returns "invalid." | 71 // If version information is unavailable, returns "invalid." |
71 std::string GetProductVersion() override; | 72 std::string GetProductVersion() override; |
72 scoped_ptr<CookieChangedSubscription> AddCookieChangedCallback( | 73 std::unique_ptr<CookieChangedSubscription> AddCookieChangedCallback( |
73 const GURL& url, | 74 const GURL& url, |
74 const std::string& name, | 75 const std::string& name, |
75 const net::CookieStore::CookieChangedCallback& callback) override; | 76 const net::CookieStore::CookieChangedCallback& callback) override; |
76 void OnSignedIn(const std::string& account_id, | 77 void OnSignedIn(const std::string& account_id, |
77 const std::string& gaia_id, | 78 const std::string& gaia_id, |
78 const std::string& username, | 79 const std::string& username, |
79 const std::string& password) override; | 80 const std::string& password) override; |
80 | 81 |
81 // SigninErrorController::Observer implementation. | 82 // SigninErrorController::Observer implementation. |
82 void OnErrorChanged() override; | 83 void OnErrorChanged() override; |
83 | 84 |
84 // gaia::GaiaOAuthClient::Delegate implementation. | 85 // gaia::GaiaOAuthClient::Delegate implementation. |
85 void OnGetTokenInfoResponse( | 86 void OnGetTokenInfoResponse( |
86 scoped_ptr<base::DictionaryValue> token_info) override; | 87 std::unique_ptr<base::DictionaryValue> token_info) override; |
87 void OnOAuthError() override; | 88 void OnOAuthError() override; |
88 void OnNetworkError(int response_code) override; | 89 void OnNetworkError(int response_code) override; |
89 | 90 |
90 // OAuth2TokenService::Consumer implementation | 91 // OAuth2TokenService::Consumer implementation |
91 void OnGetTokenSuccess(const OAuth2TokenService::Request* request, | 92 void OnGetTokenSuccess(const OAuth2TokenService::Request* request, |
92 const std::string& access_token, | 93 const std::string& access_token, |
93 const base::Time& expiration_time) override; | 94 const base::Time& expiration_time) override; |
94 void OnGetTokenFailure(const OAuth2TokenService::Request* request, | 95 void OnGetTokenFailure(const OAuth2TokenService::Request* request, |
95 const GoogleServiceAuthError& error) override; | 96 const GoogleServiceAuthError& error) override; |
96 | 97 |
97 // net::NetworkChangeController::NetworkChangeObserver implementation. | 98 // net::NetworkChangeController::NetworkChangeObserver implementation. |
98 void OnNetworkChanged( | 99 void OnNetworkChanged( |
99 net::NetworkChangeNotifier::ConnectionType type) override; | 100 net::NetworkChangeNotifier::ConnectionType type) override; |
100 | 101 |
101 private: | 102 private: |
102 ios::ChromeBrowserState* browser_state_; | 103 ios::ChromeBrowserState* browser_state_; |
103 | 104 |
104 SigninErrorController* signin_error_controller_; | 105 SigninErrorController* signin_error_controller_; |
105 std::list<base::Closure> delayed_callbacks_; | 106 std::list<base::Closure> delayed_callbacks_; |
106 | 107 |
107 scoped_ptr<gaia::GaiaOAuthClient> oauth_client_; | 108 std::unique_ptr<gaia::GaiaOAuthClient> oauth_client_; |
108 scoped_ptr<OAuth2TokenService::Request> oauth_request_; | 109 std::unique_ptr<OAuth2TokenService::Request> oauth_request_; |
109 | 110 |
110 DISALLOW_COPY_AND_ASSIGN(SigninClientImpl); | 111 DISALLOW_COPY_AND_ASSIGN(SigninClientImpl); |
111 }; | 112 }; |
112 | 113 |
113 #endif // IOS_CHROME_BROWSER_SIGNIN_SIGNIN_CLIENT_IMPL_H_ | 114 #endif // IOS_CHROME_BROWSER_SIGNIN_SIGNIN_CLIENT_IMPL_H_ |
OLD | NEW |