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

Side by Side Diff: chrome/browser/ui/webui/signin/inline_login_handler_impl.cc

Issue 196783002: Export a private webstore API to call into the new inline sign-in flow. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Redirect to the continue URL when Sync is disabled Created 6 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 #include "chrome/browser/ui/webui/signin/inline_login_handler_impl.h" 5 #include "chrome/browser/ui/webui/signin/inline_login_handler_impl.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/prefs/pref_service.h" 10 #include "base/prefs/pref_service.h"
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 email, password_, refresh_token, 142 email, password_, refresh_token,
143 OneClickSigninHelper::AUTO_ACCEPT_EXPLICIT, 143 OneClickSigninHelper::AUTO_ACCEPT_EXPLICIT,
144 source, start_mode, 144 source, start_mode,
145 base::Bind(&InlineLoginHandlerImpl::SyncStarterCallback, 145 base::Bind(&InlineLoginHandlerImpl::SyncStarterCallback,
146 handler_)); 146 handler_));
147 } 147 }
148 148
149 if (start_signin) { 149 if (start_signin) {
150 // Call OneClickSigninSyncStarter to exchange oauth code for tokens. 150 // Call OneClickSigninSyncStarter to exchange oauth code for tokens.
151 // OneClickSigninSyncStarter will delete itself once the job is done. 151 // OneClickSigninSyncStarter will delete itself once the job is done.
152 std::string continue_url_str;
153 net::GetValueForKeyInQuery(current_url_, "continueUrl",
154 &continue_url_str);
155 GURL continue_url = GURL(continue_url_str);
156 if (!continue_url.is_valid())
157 continue_url = GURL();
158
152 new OneClickSigninSyncStarter( 159 new OneClickSigninSyncStarter(
153 profile_, browser, 160 profile_, browser,
154 email, password_, refresh_token, 161 email, password_, refresh_token,
155 start_mode, 162 start_mode,
156 contents, 163 contents,
157 confirmation_required, 164 confirmation_required,
165 continue_url,
158 base::Bind(&InlineLoginHandlerImpl::SyncStarterCallback, handler_)); 166 base::Bind(&InlineLoginHandlerImpl::SyncStarterCallback, handler_));
159 } 167 }
160 } 168 }
161 169
162 base::MessageLoop::current()->DeleteSoon(FROM_HERE, this); 170 base::MessageLoop::current()->DeleteSoon(FROM_HERE, this);
163 } 171 }
164 172
165 void InlineSigninHelper::OnSigninOAuthInformationFailure( 173 void InlineSigninHelper::OnSigninOAuthInformationFailure(
166 const GoogleServiceAuthError& error) { 174 const GoogleServiceAuthError& error) {
167 if (handler_) 175 if (handler_)
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
410 TabStripModel* tab_strip_model = browser->tab_strip_model(); 418 TabStripModel* tab_strip_model = browser->tab_strip_model();
411 if (tab_strip_model) { 419 if (tab_strip_model) {
412 int index = tab_strip_model->GetIndexOfWebContents(tab); 420 int index = tab_strip_model->GetIndexOfWebContents(tab);
413 if (index != TabStripModel::kNoTab) { 421 if (index != TabStripModel::kNoTab) {
414 tab_strip_model->ExecuteContextMenuCommand( 422 tab_strip_model->ExecuteContextMenuCommand(
415 index, TabStripModel::CommandCloseTab); 423 index, TabStripModel::CommandCloseTab);
416 } 424 }
417 } 425 }
418 } 426 }
419 } 427 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698