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

Side by Side Diff: chrome/browser/ui/sync/one_click_signin_helper.h

Issue 116543007: Add cross account error detection to inline signin (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 7 years 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/ui/sync/one_click_signin_helper.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 ProfileIOData* io_data); 116 ProfileIOData* io_data);
117 117
118 // Looks for the Google-Accounts-SignIn response header, and if found, 118 // Looks for the Google-Accounts-SignIn response header, and if found,
119 // tries to display an infobar in the tab contents identified by the 119 // tries to display an infobar in the tab contents identified by the
120 // child/route id. 120 // child/route id.
121 static void ShowInfoBarIfPossible(net::URLRequest* request, 121 static void ShowInfoBarIfPossible(net::URLRequest* request,
122 ProfileIOData* io_data, 122 ProfileIOData* io_data,
123 int child_id, 123 int child_id,
124 int route_id); 124 int route_id);
125 125
126 // Handles cross account sign in error. If the supplied |email| does not match
127 // the last signed in email of the current profile, then Chrome will show a
128 // confirmation dialog before starting sync. It returns true if there is a
129 // cross ccount error, and false otherwise.
130 static bool HandleCrossAccountError(
131 content::WebContents* contents,
132 const std::string& session_index,
133 const std::string& email,
134 const std::string& password,
135 const std::string& oauth_code,
136 OneClickSigninHelper::AutoAccept auto_accept,
137 signin::Source source,
138 OneClickSigninSyncStarter::StartSyncMode start_mode,
139 OneClickSigninSyncStarter::Callback sync_callback);
140
126 // If the |source| is not settings page/webstore, redirects to 141 // If the |source| is not settings page/webstore, redirects to
127 // the NTP/Apps page. 142 // the NTP/Apps page.
128 static void RedirectToNtpOrAppsPageIfNecessary( 143 static void RedirectToNtpOrAppsPageIfNecessary(
129 content::WebContents* contents, signin::Source source); 144 content::WebContents* contents, signin::Source source);
130 145
131 static void ShowSigninErrorBubble(Browser* browser, const std::string& error); 146 static void ShowSigninErrorBubble(Browser* browser, const std::string& error);
132 147
133 // Remove the item currently at the top of the history list if it's 148 // Remove the item currently at the top of the history list if it's
134 // the Gaia redirect URL. Due to limitations of the NavigationController 149 // the Gaia redirect URL. Due to limitations of the NavigationController
135 // this cannot be done until a new page becomes "current". 150 // this cannot be done until a new page becomes "current".
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 305
291 // Allows unittest to avoid starting sync for real. 306 // Allows unittest to avoid starting sync for real.
292 bool do_not_start_sync_for_testing_; 307 bool do_not_start_sync_for_testing_;
293 308
294 base::WeakPtrFactory<OneClickSigninHelper> weak_pointer_factory_; 309 base::WeakPtrFactory<OneClickSigninHelper> weak_pointer_factory_;
295 310
296 DISALLOW_COPY_AND_ASSIGN(OneClickSigninHelper); 311 DISALLOW_COPY_AND_ASSIGN(OneClickSigninHelper);
297 }; 312 };
298 313
299 #endif // CHROME_BROWSER_UI_SYNC_ONE_CLICK_SIGNIN_HELPER_H_ 314 #endif // CHROME_BROWSER_UI_SYNC_ONE_CLICK_SIGNIN_HELPER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/sync/one_click_signin_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698