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

Side by Side Diff: chrome/browser/ui/auto_login_infobar_delegate.cc

Issue 257153003: We have a problem in the process on destroying WebContentsImpl because (Closed) Base URL: https://git.chromium.org/chromium/src.git@master
Patch Set: Rebased onto origin/lkgr Created 6 years, 7 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/auto_login_infobar_delegate.h" 5 #include "chrome/browser/ui/auto_login_infobar_delegate.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 ubertoken_fetcher_.reset(new UbertokenFetcher(token_service, 90 ubertoken_fetcher_.reset(new UbertokenFetcher(token_service,
91 this, 91 this,
92 profile->GetRequestContext())); 92 profile->GetRequestContext()));
93 ubertoken_fetcher_->StartFetchingToken( 93 ubertoken_fetcher_->StartFetchingToken(
94 signin_manager->GetAuthenticatedAccountId()); 94 signin_manager->GetAuthenticatedAccountId());
95 } 95 }
96 96
97 AutoLoginRedirector::~AutoLoginRedirector() { 97 AutoLoginRedirector::~AutoLoginRedirector() {
98 } 98 }
99 99
100 void AutoLoginRedirector::WebContentsDestroyed( 100 void AutoLoginRedirector::WebContentsDestroyed() {
101 content::WebContents* web_contents) {
102 // The WebContents that started this has been destroyed. The request must be 101 // The WebContents that started this has been destroyed. The request must be
103 // cancelled and this object must be deleted. 102 // cancelled and this object must be deleted.
104 ubertoken_fetcher_.reset(); 103 ubertoken_fetcher_.reset();
105 base::MessageLoop::current()->DeleteSoon(FROM_HERE, this); 104 base::MessageLoop::current()->DeleteSoon(FROM_HERE, this);
106 } 105 }
107 106
108 void AutoLoginRedirector::OnUbertokenSuccess(const std::string& token) { 107 void AutoLoginRedirector::OnUbertokenSuccess(const std::string& token) {
109 RedirectToMergeSession(token); 108 RedirectToMergeSession(token);
110 base::MessageLoop::current()->DeleteSoon(FROM_HERE, this); 109 base::MessageLoop::current()->DeleteSoon(FROM_HERE, this);
111 } 110 }
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 web_contents->GetBrowserContext())->GetPrefs(); 230 web_contents->GetBrowserContext())->GetPrefs();
232 pref_service->SetBoolean(prefs::kAutologinEnabled, false); 231 pref_service->SetBoolean(prefs::kAutologinEnabled, false);
233 RecordHistogramAction(REJECTED); 232 RecordHistogramAction(REJECTED);
234 button_pressed_ = true; 233 button_pressed_ = true;
235 return true; 234 return true;
236 } 235 }
237 236
238 void AutoLoginInfoBarDelegate::GoogleSignedOut(const std::string& username) { 237 void AutoLoginInfoBarDelegate::GoogleSignedOut(const std::string& username) {
239 infobar()->RemoveSelf(); 238 infobar()->RemoveSelf();
240 } 239 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698