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

Side by Side Diff: chrome/browser/ui/autofill/tab_autofill_manager_delegate.cc

Issue 19044005: Merge 210229 "Hide autofill popup before WebContentsImpl is dest..." (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1547/src/
Patch Set: Created 7 years, 5 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 (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 #include "chrome/browser/ui/autofill/tab_autofill_manager_delegate.h" 5 #include "chrome/browser/ui/autofill/tab_autofill_manager_delegate.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/prefs/pref_service.h" 8 #include "base/prefs/pref_service.h"
9 #include "chrome/browser/autofill/autocheckout_whitelist_manager_factory.h" 9 #include "chrome/browser/autofill/autocheckout_whitelist_manager_factory.h"
10 #include "chrome/browser/autofill/autofill_cc_infobar_delegate.h" 10 #include "chrome/browser/autofill/autofill_cc_infobar_delegate.h"
(...skipping 20 matching lines...) Expand all
31 namespace autofill { 31 namespace autofill {
32 32
33 TabAutofillManagerDelegate::TabAutofillManagerDelegate( 33 TabAutofillManagerDelegate::TabAutofillManagerDelegate(
34 content::WebContents* web_contents) 34 content::WebContents* web_contents)
35 : content::WebContentsObserver(web_contents), 35 : content::WebContentsObserver(web_contents),
36 web_contents_(web_contents) { 36 web_contents_(web_contents) {
37 DCHECK(web_contents); 37 DCHECK(web_contents);
38 } 38 }
39 39
40 TabAutofillManagerDelegate::~TabAutofillManagerDelegate() { 40 TabAutofillManagerDelegate::~TabAutofillManagerDelegate() {
41 HideAutofillPopup(); 41 // NOTE: It is too late to clean up the autofill popup; that cleanup process
42 // requires that the WebContents instance still be valid and it is not at
43 // this point (in particular, the WebContentsImpl destructor has already
44 // finished running and we are now in the base class destructor).
45 DCHECK(!popup_controller_);
42 } 46 }
43 47
44 PersonalDataManager* TabAutofillManagerDelegate::GetPersonalDataManager() { 48 PersonalDataManager* TabAutofillManagerDelegate::GetPersonalDataManager() {
45 Profile* profile = 49 Profile* profile =
46 Profile::FromBrowserContext(web_contents_->GetBrowserContext()); 50 Profile::FromBrowserContext(web_contents_->GetBrowserContext());
47 return PersonalDataManagerFactory::GetForProfile( 51 return PersonalDataManagerFactory::GetForProfile(
48 profile->GetOriginalProfile()); 52 profile->GetOriginalProfile());
49 } 53 }
50 54
51 PrefService* TabAutofillManagerDelegate::GetPrefs() { 55 PrefService* TabAutofillManagerDelegate::GetPrefs() {
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 content::PageTransitionIsRedirect(details.entry->GetTransitionType()); 202 content::PageTransitionIsRedirect(details.entry->GetTransitionType());
199 if (dialog_controller_.get() && 203 if (dialog_controller_.get() &&
200 (dialog_controller_->dialog_type() == DIALOG_TYPE_REQUEST_AUTOCOMPLETE || 204 (dialog_controller_->dialog_type() == DIALOG_TYPE_REQUEST_AUTOCOMPLETE ||
201 (!dialog_controller_->AutocheckoutIsRunning() && !was_redirect))) { 205 (!dialog_controller_->AutocheckoutIsRunning() && !was_redirect))) {
202 HideRequestAutocompleteDialog(); 206 HideRequestAutocompleteDialog();
203 } 207 }
204 208
205 HideAutocheckoutBubble(); 209 HideAutocheckoutBubble();
206 } 210 }
207 211
212 void TabAutofillManagerDelegate::WebContentsDestroyed(
213 content::WebContents* web_contents) {
214 HideAutofillPopup();
215 }
216
208 } // namespace autofill 217 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698