OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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_UI_WEBUI_SIGNIN_INLINE_LOGIN_HANDLER_IMPL_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_SIGNIN_INLINE_LOGIN_HANDLER_IMPL_H_ |
6 #define CHROME_BROWSER_UI_WEBUI_SIGNIN_INLINE_LOGIN_HANDLER_IMPL_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_SIGNIN_INLINE_LOGIN_HANDLER_IMPL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 bool confirm_untrusted_signin); | 163 bool confirm_untrusted_signin); |
164 ~InlineSigninHelper() override; | 164 ~InlineSigninHelper() override; |
165 | 165 |
166 private: | 166 private: |
167 // Handles cross account sign in error. If the supplied |email| does not match | 167 // Handles cross account sign in error. If the supplied |email| does not match |
168 // the last signed in email of the current profile, then Chrome will show a | 168 // the last signed in email of the current profile, then Chrome will show a |
169 // confirmation dialog before starting sync. It returns true if there is a | 169 // confirmation dialog before starting sync. It returns true if there is a |
170 // cross account error, and false otherwise. | 170 // cross account error, and false otherwise. |
171 bool HandleCrossAccountError( | 171 bool HandleCrossAccountError( |
172 const std::string& refresh_token, | 172 const std::string& refresh_token, |
173 signin_metrics::Source source, | |
174 OneClickSigninSyncStarter::ConfirmationRequired confirmation_required, | 173 OneClickSigninSyncStarter::ConfirmationRequired confirmation_required, |
175 OneClickSigninSyncStarter::StartSyncMode start_mode); | 174 OneClickSigninSyncStarter::StartSyncMode start_mode); |
176 | 175 |
177 // Callback used with ConfirmEmailDialogDelegate. | 176 // Callback used with ConfirmEmailDialogDelegate. |
178 void ConfirmEmailAction( | 177 void ConfirmEmailAction( |
179 content::WebContents* web_contents, | 178 content::WebContents* web_contents, |
180 const std::string& refresh_token, | 179 const std::string& refresh_token, |
181 signin_metrics::Source source, | |
182 OneClickSigninSyncStarter::ConfirmationRequired confirmation_required, | 180 OneClickSigninSyncStarter::ConfirmationRequired confirmation_required, |
183 OneClickSigninSyncStarter::StartSyncMode start_mode, | 181 OneClickSigninSyncStarter::StartSyncMode start_mode, |
184 Action action); | 182 Action action); |
185 | 183 |
186 // Overridden from GaiaAuthConsumer. | 184 // Overridden from GaiaAuthConsumer. |
187 void OnClientOAuthSuccess(const ClientOAuthResult& result) override; | 185 void OnClientOAuthSuccess(const ClientOAuthResult& result) override; |
188 void OnClientOAuthFailure(const GoogleServiceAuthError& error) | 186 void OnClientOAuthFailure(const GoogleServiceAuthError& error) |
189 override; | 187 override; |
190 | 188 |
191 // Creates the sync starter. Virtual for tests. Call to exchange oauth code | 189 // Creates the sync starter. Virtual for tests. Call to exchange oauth code |
192 // for tokens. | 190 // for tokens. |
193 virtual void CreateSyncStarter( | 191 virtual void CreateSyncStarter( |
194 Browser* browser, | 192 Browser* browser, |
195 content::WebContents* contents, | 193 content::WebContents* contents, |
196 const GURL& url, | 194 const GURL& current_url, |
| 195 const GURL& continue_url, |
197 const std::string& refresh_token, | 196 const std::string& refresh_token, |
198 OneClickSigninSyncStarter::StartSyncMode start_mode, | 197 OneClickSigninSyncStarter::StartSyncMode start_mode, |
199 OneClickSigninSyncStarter::ConfirmationRequired confirmation_required); | 198 OneClickSigninSyncStarter::ConfirmationRequired confirmation_required); |
200 | 199 |
201 GaiaAuthFetcher gaia_auth_fetcher_; | 200 GaiaAuthFetcher gaia_auth_fetcher_; |
202 base::WeakPtr<InlineLoginHandlerImpl> handler_; | 201 base::WeakPtr<InlineLoginHandlerImpl> handler_; |
203 Profile* profile_; | 202 Profile* profile_; |
204 GURL current_url_; | 203 GURL current_url_; |
205 std::string email_; | 204 std::string email_; |
206 std::string gaia_id_; | 205 std::string gaia_id_; |
207 std::string password_; | 206 std::string password_; |
208 std::string session_index_; | 207 std::string session_index_; |
209 std::string auth_code_; | 208 std::string auth_code_; |
210 bool choose_what_to_sync_; | 209 bool choose_what_to_sync_; |
211 bool confirm_untrusted_signin_; | 210 bool confirm_untrusted_signin_; |
212 | 211 |
213 DISALLOW_COPY_AND_ASSIGN(InlineSigninHelper); | 212 DISALLOW_COPY_AND_ASSIGN(InlineSigninHelper); |
214 }; | 213 }; |
215 | 214 |
216 #endif // CHROME_BROWSER_UI_WEBUI_SIGNIN_INLINE_LOGIN_HANDLER_IMPL_H_ | 215 #endif // CHROME_BROWSER_UI_WEBUI_SIGNIN_INLINE_LOGIN_HANDLER_IMPL_H_ |
OLD | NEW |