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

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

Issue 579033002: [Clean-up] Remove some dead code for handling Webstore sign-in. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Restore incorrectly deleted code Created 6 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
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 afbefba54f8a18613492325c2dff0132465ae4db..445242ff90ee0d4319b87173356f137ff6c6b16a 100644
--- a/chrome/browser/ui/sync/one_click_signin_helper.cc
+++ b/chrome/browser/ui/sync/one_click_signin_helper.cc
@@ -303,22 +303,15 @@ void StartExplicitSync(const OneClickSigninHelper::StartSyncArgs& args,
// Redirect/tab closing for inline flow is handled by the sync callback.
args.callback.Run(OneClickSigninSyncStarter::SYNC_SETUP_FAILURE);
} else {
- // Don't redirect when the visible URL is not a blank page: if the
- // source is SOURCE_WEBSTORE_INSTALL, |contents| might be showing an app
- // page that shouldn't be hidden.
- //
- // If redirecting, don't do so immediately, otherwise there may be 2
- // nested navigations and a crash would occur (crbug.com/293261). Post
- // the task to the current thread instead.
- if (signin::IsContinueUrlForWebBasedSigninFlow(
- contents->GetVisibleURL())) {
- base::MessageLoopProxy::current()->PostNonNestableTask(
- FROM_HERE,
- base::Bind(RedirectToNtpOrAppsPageWithIds,
- contents->GetRenderProcessHost()->GetID(),
- contents->GetRoutingID(),
- args.source));
- }
+ // Redirect, but don't do so immediately; otherwise there might be two
+ // nested navigations, which would cause a crash: http://crbug.com/293261
+ // Instead, post a task to the current thread.
+ base::MessageLoopProxy::current()->PostNonNestableTask(
+ FROM_HERE,
+ base::Bind(RedirectToNtpOrAppsPageWithIds,
+ contents->GetRenderProcessHost()->GetID(),
+ contents->GetRoutingID(),
+ args.source));
}
if (action == ConfirmEmailDialogDelegate::CREATE_NEW_USER) {
chrome::ShowSettingsSubPage(args.browser,
@@ -528,9 +521,8 @@ OneClickSigninHelper::StartSyncArgs::StartSyncArgs(
DCHECK(session_index.empty() != refresh_token.empty());
if (untrusted_confirmation_required) {
confirmation_required = OneClickSigninSyncStarter::CONFIRM_UNTRUSTED_SIGNIN;
- } else if (source == signin::SOURCE_SETTINGS ||
- source == signin::SOURCE_WEBSTORE_INSTALL) {
- // Do not display a status confirmation for webstore installs or re-auth.
+ } else if (source == signin::SOURCE_SETTINGS) {
+ // Do not display a status confirmation for re-auth.
confirmation_required = OneClickSigninSyncStarter::NO_CONFIRMATION;
} else {
confirmation_required = OneClickSigninSyncStarter::CONFIRM_AFTER_SIGNIN;
@@ -727,10 +719,6 @@ void OneClickSigninHelper::LogHistogramValue(
UMA_HISTOGRAM_ENUMERATION("Signin.ExtensionInstallBubbleActions", action,
one_click_signin::HISTOGRAM_MAX);
break;
- case signin::SOURCE_WEBSTORE_INSTALL:
- UMA_HISTOGRAM_ENUMERATION("Signin.WebstoreInstallActions", action,
- one_click_signin::HISTOGRAM_MAX);
- break;
case signin::SOURCE_APP_LAUNCHER:
UMA_HISTOGRAM_ENUMERATION("Signin.AppLauncherActions", action,
one_click_signin::HISTOGRAM_MAX);
@@ -761,7 +749,7 @@ void OneClickSigninHelper::LogHistogramValue(
break;
default:
// This switch statement needs to be updated when the enum Source changes.
- COMPILE_ASSERT(signin::SOURCE_UNKNOWN == 13,
+ COMPILE_ASSERT(signin::SOURCE_UNKNOWN == 12,
kSourceEnumHasChangedButNotThisSwitchStatement);
UMA_HISTOGRAM_ENUMERATION("Signin.UnknownActions", action,
one_click_signin::HISTOGRAM_MAX);
@@ -1212,8 +1200,7 @@ void OneClickSigninHelper::RedirectToNtpOrAppsPage(
// static
void OneClickSigninHelper::RedirectToNtpOrAppsPageIfNecessary(
content::WebContents* contents, signin::Source source) {
- if (source != signin::SOURCE_SETTINGS &&
- source != signin::SOURCE_WEBSTORE_INSTALL) {
+ if (source != signin::SOURCE_SETTINGS) {
RedirectToNtpOrAppsPage(contents, source);
}
}
@@ -1555,13 +1542,10 @@ void OneClickSigninHelper::DidStopLoading(
RedirectToNtpOrAppsPageIfNecessary(web_contents(), source_);
}
- // Observe the sync service if the Webstore tab or the settings tab
- // requested a gaia sign in, so that when sign in and sync setup are
- // successful, we can redirect to the correct URL, or auto-close the gaia
- // sign in tab.
- if (original_source == signin::SOURCE_SETTINGS ||
- (original_source == signin::SOURCE_WEBSTORE_INSTALL &&
- source_ == signin::SOURCE_SETTINGS)) {
+ // Observe the sync service if the settings tab requested a gaia sign in,
+ // so that when sign in and sync setup are successful, we can redirect to
+ // the correct URL, or auto-close the gaia sign in tab.
+ if (original_source == signin::SOURCE_SETTINGS) {
// The observer deletes itself once it's done.
new OneClickSigninSyncObserver(contents, original_continue_url_);
}
« no previous file with comments | « chrome/browser/signin/signin_promo_unittest.cc ('k') | chrome/browser/ui/sync/one_click_signin_helper_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698