diff options
author | erg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-22 17:10:27 +0000 |
---|---|---|
committer | erg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-22 17:10:27 +0000 |
commit | 6a4ea5c906bc73b61fa11abba556d6438d3f2063 (patch) | |
tree | 2ed6de3ff18e0c93eb6470cf57f9c88f7352eff1 /chrome/browser/autocomplete/autocomplete_popup_view_gtk.h | |
parent | 76a8b02ee73445796fb7996a26583bc3d89da152 (diff) | |
download | chromium_src-6a4ea5c906bc73b61fa11abba556d6438d3f2063.zip chromium_src-6a4ea5c906bc73b61fa11abba556d6438d3f2063.tar.gz chromium_src-6a4ea5c906bc73b61fa11abba556d6438d3f2063.tar.bz2 |
GTK: Implement OnDragCanceled() for autocomplete popup view on linux.
Pressing escape while performing a drag inside the autocomplete popup should
abort the drag and not changed the selected item. This is a rewrite of
pkasting's r37724 for GTK instead of views.
BUG=35710
TEST=none
Review URL: http://codereview.chromium.org/1758002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45322 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autocomplete/autocomplete_popup_view_gtk.h')
-rw-r--r-- | chrome/browser/autocomplete/autocomplete_popup_view_gtk.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/chrome/browser/autocomplete/autocomplete_popup_view_gtk.h b/chrome/browser/autocomplete/autocomplete_popup_view_gtk.h index f46cfb2..a56a55a 100644 --- a/chrome/browser/autocomplete/autocomplete_popup_view_gtk.h +++ b/chrome/browser/autocomplete/autocomplete_popup_view_gtk.h @@ -31,7 +31,7 @@ class AutocompletePopupViewGtk : public AutocompletePopupView { virtual void InvalidateLine(size_t line); virtual void UpdatePopupAppearance(); virtual void PaintUpdatesNow(); - virtual void OnDragCanceled() {} + virtual void OnDragCanceled(); virtual AutocompletePopupModel* GetModel(); private: @@ -87,6 +87,14 @@ class AutocompletePopupViewGtk : public AutocompletePopupView { // The pango layout object created from the window, cached across exposes. PangoLayout* layout_; + // If the user cancels a dragging action (i.e. by pressing ESC), we don't have + // a convenient way to release mouse capture. Instead we use this flag to + // simply ignore all remaining drag events, and the eventual mouse release + // event. Since OnDragCanceled() can be called when we're not dragging, this + // flag is reset to false on a mouse pressed event, to make sure we don't + // erroneously ignore the next drag. + bool ignore_mouse_drag_; + // Whether our popup is currently open / shown, or closed / hidden. bool opened_; |