summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authorjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-25 22:01:00 +0000
committerjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-25 22:01:00 +0000
commit30f75e618e08b5bd943feec72261cc36a8fd9280 (patch)
tree7f108ae961dc8ff5b11f904bdbc4894247f2c7c0 /chrome/browser
parente191c147e4704d4e75f548cdaf90f914d196aa63 (diff)
downloadchromium_src-30f75e618e08b5bd943feec72261cc36a8fd9280.zip
chromium_src-30f75e618e08b5bd943feec72261cc36a8fd9280.tar.gz
chromium_src-30f75e618e08b5bd943feec72261cc36a8fd9280.tar.bz2
This CL causes the autofill popup to hide when the browser window is moved or resized.
TEST=Bring up an autofill popup in a form, move the browser. The autofill popup should be closed. BUG=7401 R=ben Review URL: http://codereview.chromium.org/28126 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10384 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/renderer_host/render_view_host.cc4
-rw-r--r--chrome/browser/renderer_host/render_view_host.h4
-rw-r--r--chrome/browser/tab_contents/web_contents.h4
-rw-r--r--chrome/browser/views/frame/aero_glass_frame.cc4
-rw-r--r--chrome/browser/views/frame/aero_glass_frame.h1
-rw-r--r--chrome/browser/views/frame/browser_view.cc6
-rw-r--r--chrome/browser/views/frame/browser_view.h4
-rw-r--r--chrome/browser/views/frame/opaque_frame.cc4
-rw-r--r--chrome/browser/views/frame/opaque_frame.h1
9 files changed, 32 insertions, 0 deletions
diff --git a/chrome/browser/renderer_host/render_view_host.cc b/chrome/browser/renderer_host/render_view_host.cc
index edff720..28117c2 100644
--- a/chrome/browser/renderer_host/render_view_host.cc
+++ b/chrome/browser/renderer_host/render_view_host.cc
@@ -1266,6 +1266,10 @@ void RenderViewHost::AutofillSuggestionsReturned(
// Default index -1 means no default suggestion.
}
+void RenderViewHost::WindowMoveOrResizeStarted() {
+ Send(new ViewMsg_MoveOrResizeStarted(routing_id()));
+}
+
void RenderViewHost::NotifyRendererUnresponsive() {
// If the debugger is attached, we're going to be unresponsive anytime it's
// stopped at a breakpoint.
diff --git a/chrome/browser/renderer_host/render_view_host.h b/chrome/browser/renderer_host/render_view_host.h
index 2974db6..39704f3 100644
--- a/chrome/browser/renderer_host/render_view_host.h
+++ b/chrome/browser/renderer_host/render_view_host.h
@@ -404,6 +404,10 @@ class RenderViewHost : public RenderWidgetHost {
int request_id,
int default_suggestion_index);
+ // Notifies the Renderer that a move or resize of its containing window has
+ // started (this is used to hide the autocomplete popups if any).
+ void WindowMoveOrResizeStarted();
+
// RenderWidgetHost public overrides.
virtual void Init();
virtual void Shutdown();
diff --git a/chrome/browser/tab_contents/web_contents.h b/chrome/browser/tab_contents/web_contents.h
index 3974a78..9ed4331 100644
--- a/chrome/browser/tab_contents/web_contents.h
+++ b/chrome/browser/tab_contents/web_contents.h
@@ -265,6 +265,10 @@ class WebContents : public TabContents,
render_manager_.CrossSiteNavigationCanceled();
}
+ void WindowMoveOrResizeStarted() {
+ render_view_host()->WindowMoveOrResizeStarted();
+ }
+
protected:
// Should be deleted via CloseContents.
virtual ~WebContents();
diff --git a/chrome/browser/views/frame/aero_glass_frame.cc b/chrome/browser/views/frame/aero_glass_frame.cc
index 67d40d2..d51b69c 100644
--- a/chrome/browser/views/frame/aero_glass_frame.cc
+++ b/chrome/browser/views/frame/aero_glass_frame.cc
@@ -105,6 +105,10 @@ void AeroGlassFrame::OnInitMenuPopup(HMENU menu, UINT position,
browser_view_->PrepareToRunSystemMenu(menu);
}
+void AeroGlassFrame::OnEnterSizeMove() {
+ browser_view_->WindowMoveOrResizeStarted();
+}
+
void AeroGlassFrame::OnEndSession(BOOL ending, UINT logoff) {
BrowserList::WindowsSessionEnding();
}
diff --git a/chrome/browser/views/frame/aero_glass_frame.h b/chrome/browser/views/frame/aero_glass_frame.h
index 2541467..4c7e2f8 100644
--- a/chrome/browser/views/frame/aero_glass_frame.h
+++ b/chrome/browser/views/frame/aero_glass_frame.h
@@ -44,6 +44,7 @@ class AeroGlassFrame : public BrowserFrame,
virtual bool AcceleratorPressed(views::Accelerator* accelerator);
virtual bool GetAccelerator(int cmd_id, views::Accelerator* accelerator);
virtual void OnInitMenuPopup(HMENU menu, UINT position, BOOL is_system_menu);
+ virtual void OnEnterSizeMove();
virtual void OnEndSession(BOOL ending, UINT logoff);
virtual LRESULT OnMouseActivate(HWND window,
UINT hittest_code,
diff --git a/chrome/browser/views/frame/browser_view.cc b/chrome/browser/views/frame/browser_view.cc
index 898a147..d1aae0b 100644
--- a/chrome/browser/views/frame/browser_view.cc
+++ b/chrome/browser/views/frame/browser_view.cc
@@ -247,6 +247,12 @@ void BrowserView::WindowMoved() {
toolbar_->GetLocationBarView()->location_entry()->ClosePopup();
}
+void BrowserView::WindowMoveOrResizeStarted() {
+ TabContents* tab_contents = GetSelectedTabContents();
+ if (tab_contents && tab_contents->AsWebContents())
+ tab_contents->AsWebContents()->WindowMoveOrResizeStarted();
+}
+
gfx::Rect BrowserView::GetToolbarBounds() const {
return toolbar_->bounds();
}
diff --git a/chrome/browser/views/frame/browser_view.h b/chrome/browser/views/frame/browser_view.h
index c2af520..12634b9 100644
--- a/chrome/browser/views/frame/browser_view.h
+++ b/chrome/browser/views/frame/browser_view.h
@@ -68,6 +68,10 @@ class BrowserView : public BrowserWindow,
// any dependent popup windows should be repositioned.
void WindowMoved();
+ // Called by the frame to notify the BrowserView that a move or resize was
+ // initiated.
+ void WindowMoveOrResizeStarted();
+
// Returns the bounds of the toolbar, in BrowserView coordinates.
gfx::Rect GetToolbarBounds() const;
diff --git a/chrome/browser/views/frame/opaque_frame.cc b/chrome/browser/views/frame/opaque_frame.cc
index 5895418..066bcad 100644
--- a/chrome/browser/views/frame/opaque_frame.cc
+++ b/chrome/browser/views/frame/opaque_frame.cc
@@ -89,6 +89,10 @@ void OpaqueFrame::OnEndSession(BOOL ending, UINT logoff) {
BrowserList::WindowsSessionEnding();
}
+void OpaqueFrame::OnEnterSizeMove() {
+ browser_view_->WindowMoveOrResizeStarted();
+}
+
void OpaqueFrame::OnInitMenuPopup(HMENU menu, UINT position,
BOOL is_system_menu) {
browser_view_->PrepareToRunSystemMenu(menu);
diff --git a/chrome/browser/views/frame/opaque_frame.h b/chrome/browser/views/frame/opaque_frame.h
index 8a02595..7042002 100644
--- a/chrome/browser/views/frame/opaque_frame.h
+++ b/chrome/browser/views/frame/opaque_frame.h
@@ -49,6 +49,7 @@ class OpaqueFrame : public BrowserFrame,
// Overridden from views::WidgetWin:
virtual bool AcceleratorPressed(views::Accelerator* accelerator);
virtual bool GetAccelerator(int cmd_id, views::Accelerator* accelerator);
+ virtual void OnEnterSizeMove();
virtual void OnEndSession(BOOL ending, UINT logoff);
virtual void OnInitMenuPopup(HMENU menu, UINT position, BOOL is_system_menu);
virtual LRESULT OnMouseActivate(HWND window,