| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_SYNC_ONE_CLICK_SIGNIN_HELPER_H_ | 5 #ifndef CHROME_BROWSER_UI_SYNC_ONE_CLICK_SIGNIN_HELPER_H_ |
| 6 #define CHROME_BROWSER_UI_SYNC_ONE_CLICK_SIGNIN_HELPER_H_ | 6 #define CHROME_BROWSER_UI_SYNC_ONE_CLICK_SIGNIN_HELPER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/gtest_prod_util.h" | 10 #include "base/gtest_prod_util.h" |
| 11 #include "chrome/browser/signin/signin_tracker.h" | 11 #include "chrome/browser/signin/signin_tracker.h" |
| 12 #include "chrome/browser/ui/webui/sync_promo/sync_promo_ui.h" | 12 #include "chrome/browser/ui/webui/sync_promo/sync_promo_ui.h" |
| 13 #include "content/public/browser/web_contents_observer.h" | 13 #include "content/public/browser/web_contents_observer.h" |
| 14 #include "content/public/browser/web_contents_user_data.h" | 14 #include "content/public/browser/web_contents_user_data.h" |
| 15 #include "google_apis/gaia/google_service_auth_error.h" | 15 #include "google_apis/gaia/google_service_auth_error.h" |
| 16 | 16 |
| 17 class GURL; | 17 class GURL; |
| 18 class ProfileIOData; | 18 class ProfileIOData; |
| 19 | 19 |
| 20 namespace content { | 20 namespace content { |
| 21 class WebContents; | 21 class WebContents; |
| 22 struct PasswordForm; |
| 22 } | 23 } |
| 23 | 24 |
| 24 namespace net { | 25 namespace net { |
| 25 class URLRequest; | 26 class URLRequest; |
| 26 } | 27 } |
| 27 | 28 |
| 28 // Per-tab one-click signin helper. When a user signs in to a Google service | 29 // Per-tab one-click signin helper. When a user signs in to a Google service |
| 29 // and the profile is not yet connected to a Google account, will start the | 30 // and the profile is not yet connected to a Google account, will start the |
| 30 // process of helping the user connect his profile with one click. The process | 31 // process of helping the user connect his profile with one click. The process |
| 31 // begins with an infobar and is followed with a confirmation dialog explaining | 32 // begins with an infobar and is followed with a confirmation dialog explaining |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 SyncPromoUI::Source source, | 168 SyncPromoUI::Source source, |
| 168 const GURL& continue_url, | 169 const GURL& continue_url, |
| 169 int child_id, | 170 int child_id, |
| 170 int route_id); | 171 int route_id); |
| 171 | 172 |
| 172 void RedirectToNTP(); | 173 void RedirectToNTP(); |
| 173 | 174 |
| 174 // Clear all data member of the helper, except for the error. | 175 // Clear all data member of the helper, except for the error. |
| 175 void CleanTransientState(); | 176 void CleanTransientState(); |
| 176 | 177 |
| 178 // Grab Gaia password if available. |
| 179 bool OnFormSubmitted(const content::PasswordForm& form); |
| 180 |
| 177 // content::WebContentsObserver overrides. | 181 // content::WebContentsObserver overrides. |
| 178 virtual void DidNavigateAnyFrame( | 182 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
| 179 const content::LoadCommittedDetails& details, | |
| 180 const content::FrameNavigateParams& params) OVERRIDE; | |
| 181 virtual void DidStopLoading( | 183 virtual void DidStopLoading( |
| 182 content::RenderViewHost* render_view_host) OVERRIDE; | 184 content::RenderViewHost* render_view_host) OVERRIDE; |
| 183 | 185 |
| 184 // SigninTracker::Observer override. | 186 // SigninTracker::Observer override. |
| 185 virtual void GaiaCredentialsValid() OVERRIDE; | 187 virtual void GaiaCredentialsValid() OVERRIDE; |
| 186 virtual void SigninFailed(const GoogleServiceAuthError& error) OVERRIDE; | 188 virtual void SigninFailed(const GoogleServiceAuthError& error) OVERRIDE; |
| 187 virtual void SigninSuccess() OVERRIDE; | 189 virtual void SigninSuccess() OVERRIDE; |
| 188 | 190 |
| 189 // Information about the account that has just logged in. | 191 // Information about the account that has just logged in. |
| 190 std::string session_index_; | 192 std::string session_index_; |
| 191 std::string email_; | 193 std::string email_; |
| 192 std::string password_; | 194 std::string password_; |
| 193 AutoAccept auto_accept_; | 195 AutoAccept auto_accept_; |
| 194 SyncPromoUI::Source source_; | 196 SyncPromoUI::Source source_; |
| 195 GURL continue_url_; | 197 GURL continue_url_; |
| 196 std::string error_message_; | 198 std::string error_message_; |
| 197 | 199 |
| 198 scoped_ptr<SigninTracker> signin_tracker_; | 200 scoped_ptr<SigninTracker> signin_tracker_; |
| 199 | 201 |
| 200 DISALLOW_COPY_AND_ASSIGN(OneClickSigninHelper); | 202 DISALLOW_COPY_AND_ASSIGN(OneClickSigninHelper); |
| 201 }; | 203 }; |
| 202 | 204 |
| 203 #endif // CHROME_BROWSER_UI_SYNC_ONE_CLICK_SIGNIN_HELPER_H_ | 205 #endif // CHROME_BROWSER_UI_SYNC_ONE_CLICK_SIGNIN_HELPER_H_ |
| OLD | NEW |