Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(725)

Unified Diff: chrome/browser/ui/sync/one_click_signin_helper.cc

Issue 10928242: Switch OneClickSigninHelper to use WebContentsUserData. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/sync/one_click_signin_helper.h ('k') | chrome/browser/ui/tab_contents/tab_contents.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/sync/one_click_signin_helper.cc
diff --git a/chrome/browser/ui/sync/one_click_signin_helper.cc b/chrome/browser/ui/sync/one_click_signin_helper.cc
index ab839b5cc019ce884d9e36f31c29bebe0aa353d3..b63d7c5a72ba5902ac534c7d76011e4ae54ca4b4 100644
--- a/chrome/browser/ui/sync/one_click_signin_helper.cc
+++ b/chrome/browser/ui/sync/one_click_signin_helper.cc
@@ -48,6 +48,8 @@
#include "webkit/forms/password_form.h"
#include "webkit/forms/password_form_dom_manager.h"
+int OneClickSigninHelper::kUserDataKey;
+
namespace {
// Set to true if this chrome instance is in the blue-button-on-white-bar
@@ -378,16 +380,14 @@ void OneClickSigninHelper::ShowInfoBarUIThread(
if (!web_contents || !CanOffer(web_contents, email, true))
return;
- TabContents* tab_contents = TabContents::FromWebContents(web_contents);
- if (!tab_contents)
+ OneClickSigninHelper* one_click_signin_tab_helper =
+ OneClickSigninHelper::FromWebContents(web_contents);
+ // The manager may not exist if the contents is incognito or if the profile is
+ // already connected to a Google account.
+ if (!one_click_signin_tab_helper)
return;
- // Save the email in the one-click signin manager. The manager may
- // not exist if the contents is incognito or if the profile is already
- // connected to a Google account.
- OneClickSigninHelper* helper = tab_contents->one_click_signin_helper();
- if (helper)
- helper->SaveSessionIndexAndEmail(session_index, email);
+ one_click_signin_tab_helper->SaveSessionIndexAndEmail(session_index, email);
}
void OneClickSigninHelper::DidNavigateAnyFrame(
« no previous file with comments | « chrome/browser/ui/sync/one_click_signin_helper.h ('k') | chrome/browser/ui/tab_contents/tab_contents.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698