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

Unified Diff: chrome/browser/ui/autofill/chrome_autofill_client.cc

Issue 377423002: Make ChromeAutofillClient a ZoomObserver. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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.h ('k') | chrome/browser/ui/tab_helpers.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/autofill/chrome_autofill_client.cc
diff --git a/chrome/browser/ui/autofill/chrome_autofill_client.cc b/chrome/browser/ui/autofill/chrome_autofill_client.cc
index d848917132c9be6350cbc02e862f67818941a729..c3d985a994d60bfff8950e15cdf29f785ba2d38e 100644
--- a/chrome/browser/ui/autofill/chrome_autofill_client.cc
+++ b/chrome/browser/ui/autofill/chrome_autofill_client.cc
@@ -37,6 +37,11 @@ namespace autofill {
ChromeAutofillClient::ChromeAutofillClient(content::WebContents* web_contents)
: content::WebContentsObserver(web_contents), web_contents_(web_contents) {
DCHECK(web_contents);
+ ZoomController* zoom_controller =
+ ZoomController::FromWebContents(web_contents);
+ // No ZoomControllers on Android.
+ if (zoom_controller)
+ zoom_controller->AddObserver(this);
#if defined(OS_MACOSX) && !defined(OS_IOS)
RegisterForKeystoneNotifications();
#endif // defined(OS_MACOSX) && !defined(OS_IOS)
@@ -172,6 +177,14 @@ void ChromeAutofillClient::WebContentsDestroyed() {
HideAutofillPopup();
}
+void ChromeAutofillClient::OnZoomChanged(
+ const ZoomController::ZoomChangedEventData& data) {
+ // TODO(wjmaclean) Decide if we want to hide the popup for any zoom event, not
+ // just zoom events for web_contents_.
Ilya Sherman 2014/07/09 21:52:43 What other zoom events are possible?
wjmaclean 2014/07/10 14:47:35 ZoomObservers are notified of the following: 1) ch
+ if (data.web_contents == web_contents_)
+ HideAutofillPopup();
+}
+
void ChromeAutofillClient::DetectAccountCreationForms(
const std::vector<autofill::FormStructure*>& forms) {
password_manager::PasswordGenerationManager* manager =
« no previous file with comments | « chrome/browser/ui/autofill/chrome_autofill_client.h ('k') | chrome/browser/ui/tab_helpers.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698