diff options
author | tony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-20 20:18:50 +0000 |
---|---|---|
committer | tony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-20 20:18:50 +0000 |
commit | c80aa4e9323c21d780574955da7a6dbc1eec6d19 (patch) | |
tree | f6ec59269f1fa81d1a82671c169c4f7f4d8f1ab8 /chrome | |
parent | 465ae14d9f7542a35afa2722e58c0de9800b0fd5 (diff) | |
download | chromium_src-c80aa4e9323c21d780574955da7a6dbc1eec6d19.zip chromium_src-c80aa4e9323c21d780574955da7a6dbc1eec6d19.tar.gz chromium_src-c80aa4e9323c21d780574955da7a6dbc1eec6d19.tar.bz2 |
Close the autocomplete popup when the user tries to move the
window with the custom frame, when the user tries to resize
the window with the custom frame, and when the window switches
between maximized/restored state.
BUG=19636
Review URL: http://codereview.chromium.org/174109
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23866 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/gtk/browser_window_gtk.cc | 15 | ||||
-rw-r--r-- | chrome/browser/gtk/browser_window_gtk.h | 2 |
2 files changed, 8 insertions, 9 deletions
diff --git a/chrome/browser/gtk/browser_window_gtk.cc b/chrome/browser/gtk/browser_window_gtk.cc index a91c218..efdf96b 100644 --- a/chrome/browser/gtk/browser_window_gtk.cc +++ b/chrome/browser/gtk/browser_window_gtk.cc @@ -24,6 +24,7 @@ #include "base/time.h" #include "chrome/app/chrome_dll_resource.h" #include "chrome/browser/app_modal_dialog_queue.h" +#include "chrome/browser/autocomplete/autocomplete_edit_view.h" #include "chrome/browser/bookmarks/bookmark_utils.h" #include "chrome/browser/browser.h" #include "chrome/browser/browser_list.h" @@ -122,7 +123,7 @@ gboolean MainWindowConfigured(GtkWindow* window, GdkEventConfigure* event, gboolean MainWindowStateChanged(GtkWindow* window, GdkEventWindowState* event, BrowserWindowGtk* browser_win) { - browser_win->OnStateChanged(event->new_window_state); + browser_win->OnStateChanged(event->new_window_state, event->changed_mask); return FALSE; } @@ -1164,6 +1165,8 @@ void BrowserWindowGtk::DestroyBrowser() { } void BrowserWindowGtk::OnBoundsChanged(const gfx::Rect& bounds) { + GetLocationBar()->location_entry()->ClosePopup(); + if (bounds_.size() != bounds.size()) OnSizeChanged(bounds.width(), bounds.height()); @@ -1173,15 +1176,11 @@ void BrowserWindowGtk::OnBoundsChanged(const gfx::Rect& bounds) { SaveWindowPosition(); } -void BrowserWindowGtk::OnStateChanged(GdkWindowState state) { - // If we care about more than full screen changes, we should pass through - // |changed_mask| from GdkEventWindowState. - bool fullscreen_state_changed = (state_ & GDK_WINDOW_STATE_FULLSCREEN) != - (state & GDK_WINDOW_STATE_FULLSCREEN); - +void BrowserWindowGtk::OnStateChanged(GdkWindowState state, + GdkWindowState changed_mask) { state_ = state; - if (fullscreen_state_changed) { + if (changed_mask & GDK_WINDOW_STATE_FULLSCREEN) { bool is_fullscreen = state & GDK_WINDOW_STATE_FULLSCREEN; browser_->UpdateCommandsForFullscreenMode(is_fullscreen); if (is_fullscreen) { diff --git a/chrome/browser/gtk/browser_window_gtk.h b/chrome/browser/gtk/browser_window_gtk.h index 7af9c11..10e6dbb 100644 --- a/chrome/browser/gtk/browser_window_gtk.h +++ b/chrome/browser/gtk/browser_window_gtk.h @@ -134,7 +134,7 @@ class BrowserWindowGtk : public BrowserWindow, void UpdateUIForContents(TabContents* contents); void OnBoundsChanged(const gfx::Rect& bounds); - void OnStateChanged(GdkWindowState state); + void OnStateChanged(GdkWindowState state, GdkWindowState changed_mask); // Returns false if we're not ready to close yet. E.g., a tab may have an // onbeforeunload handler that prevents us from closing. |