diff options
author | csharp@chromium.org <csharp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-25 16:26:26 +0000 |
---|---|---|
committer | csharp@chromium.org <csharp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-25 16:26:26 +0000 |
commit | 2b942c335ed41df16205713d9a6749a8bda556c9 (patch) | |
tree | 51770a02979575ea6b6a17acc8c8d24254a13b09 /chrome | |
parent | 5784bd14417a7d68a23ec2c1f8c5d0f4e4df872c (diff) | |
download | chromium_src-2b942c335ed41df16205713d9a6749a8bda556c9.zip chromium_src-2b942c335ed41df16205713d9a6749a8bda556c9.tar.gz chromium_src-2b942c335ed41df16205713d9a6749a8bda556c9.tar.bz2 |
Add ZoomLevelChanged and DidChangeScrollOffset to RenderViewObserver
Add ZoomLevelChanged and DidChangeScrollOffset to RenderViewObserver and setup the new Autofill UI to use them to detect when the why content on a page has shifted and any visible popup should be hidden.
BUG=103564
TEST=When using the new Autofill UI scrolling will now cause any visible popups to disappear
Review URL: http://codereview.chromium.org/10218001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@133924 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/renderer/autofill/autofill_agent.cc | 14 | ||||
-rw-r--r-- | chrome/renderer/autofill/autofill_agent.h | 2 |
2 files changed, 16 insertions, 0 deletions
diff --git a/chrome/renderer/autofill/autofill_agent.cc b/chrome/renderer/autofill/autofill_agent.cc index f250e4f..0b28d45 100644 --- a/chrome/renderer/autofill/autofill_agent.cc +++ b/chrome/renderer/autofill/autofill_agent.cc @@ -155,6 +155,20 @@ void AutofillAgent::WillSubmitForm(WebFrame* frame, } } +void AutofillAgent::ZoomLevelChanged() { + // Any time the zoom level changes, the page's content moves, so any Autofill + // popups should be hidden. This is only needed for the new Autofill UI + // because WebKit already knows to hide the old UI when this occurs. + Send(new AutofillHostMsg_HideAutofillPopup(routing_id())); +} + +void AutofillAgent::DidChangeScrollOffset(WebKit::WebFrame*) { + // Any time the scroll offset changes, the page's content moves, so Autofill + // popups should be hidden. This is only needed for the new Autofill UI + // because WebKit already knows to hide the old UI when this occurs. + Send(new AutofillHostMsg_HideAutofillPopup(routing_id())); +} + bool AutofillAgent::InputElementClicked(const WebInputElement& element, bool was_focused, bool is_focused) { diff --git a/chrome/renderer/autofill/autofill_agent.h b/chrome/renderer/autofill/autofill_agent.h index f9b0364..f0f5173 100644 --- a/chrome/renderer/autofill/autofill_agent.h +++ b/chrome/renderer/autofill/autofill_agent.h @@ -65,6 +65,8 @@ class AutofillAgent : public content::RenderViewObserver, virtual void FrameWillClose(WebKit::WebFrame* frame) OVERRIDE; virtual void WillSubmitForm(WebKit::WebFrame* frame, const WebKit::WebFormElement& form) OVERRIDE; + virtual void ZoomLevelChanged() OVERRIDE; + virtual void DidChangeScrollOffset(WebKit::WebFrame* frame) OVERRIDE; // PageClickListener: virtual bool InputElementClicked(const WebKit::WebInputElement& element, |