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

Unified Diff: chrome/browser/ui/tab_helpers.cc

Issue 377423002: Make ChromeAutofillClient a ZoomObserver. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Simplify ChromeAutofillClient dependance on ZoomController. Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/autofill/chrome_autofill_client.cc ('k') | chrome/browser/ui/zoom/zoom_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/tab_helpers.cc
diff --git a/chrome/browser/ui/tab_helpers.cc b/chrome/browser/ui/tab_helpers.cc
index a8d1d09311fa90c7e317240de89da569c4e5ac96..f696e5cb6b2f33aea6da737f165565d0ed72c157 100644
--- a/chrome/browser/ui/tab_helpers.cc
+++ b/chrome/browser/ui/tab_helpers.cc
@@ -165,6 +165,13 @@ void TabHelpers::AttachTabHelpers(WebContents* web_contents) {
ThumbnailTabHelper::CreateForWebContents(web_contents);
web_modal::WebContentsModalDialogManager::CreateForWebContents(web_contents);
ZoomController::CreateForWebContents(web_contents);
+ // The ChromeAutofillClient is also a ZoomObserver, so we connect it to the
+ // ZoomController here. Since both are WebContentsObservers they cannot be
+ // dependant on their order of destruction: ZoomController silently clears
+ // its ZoomObserver list during WebContentsDestroyed() so there's no need
+ // for the ChromeAutofillClient to remove itself as an observer.
+ ZoomController::FromWebContents(web_contents)->AddObserver(
+ autofill::ChromeAutofillClient::FromWebContents(web_contents));
Avi (use Gerrit) 2014/07/10 14:59:53 :( I would much rather move ZoomController before
#endif
#if defined(OS_WIN)
« no previous file with comments | « chrome/browser/ui/autofill/chrome_autofill_client.cc ('k') | chrome/browser/ui/zoom/zoom_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698