diff options
author | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-03 18:34:24 +0000 |
---|---|---|
committer | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-03 18:34:24 +0000 |
commit | 0f9cf9774f4bf04febc159f12c5b4e708a19ed4f (patch) | |
tree | 9ad5a5849fd3e7249cd12e1c61a6be2a98c7b520 /chrome/browser/autocomplete | |
parent | d8018ea68dd32949dbf2d388c38c4ea23f7dbdf2 (diff) | |
download | chromium_src-0f9cf9774f4bf04febc159f12c5b4e708a19ed4f.zip chromium_src-0f9cf9774f4bf04febc159f12c5b4e708a19ed4f.tar.gz chromium_src-0f9cf9774f4bf04febc159f12c5b4e708a19ed4f.tar.bz2 |
Make the omnibox 2 hover code a tiny bit less goofy by removing a now-unused function (although it may have to come back eventually) and using the Model's conception of hover state instead of direct hot-tracking in the view.
Unfortunately, there are still problems, including bogus mousemove events for the same point and no WM_MOUSELEAVE events, all of which the old code handled. I think fixing this is going to require implementing a TODO in the code to hoist mouse handling to the main dropdown view, at which point I can probably address issue 13703 as well.
BUG=13279
TEST=none
Review URL: http://codereview.chromium.org/187002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25336 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autocomplete')
5 files changed, 2 insertions, 15 deletions
diff --git a/chrome/browser/autocomplete/autocomplete_popup_model.cc b/chrome/browser/autocomplete/autocomplete_popup_model.cc index 44c14c2..57d101ae 100644 --- a/chrome/browser/autocomplete/autocomplete_popup_model.cc +++ b/chrome/browser/autocomplete/autocomplete_popup_model.cc @@ -71,17 +71,13 @@ void AutocompletePopupModel::SetHoveredLine(size_t line) { // Make sure the old hovered line is redrawn. No need to redraw the selected // line since selection overrides hover so the appearance won't change. - const bool is_enabling = (hovered_line_ == kNoMatch); - if (!is_enabling && (hovered_line_ != selected_line_)) + if ((hovered_line_ != kNoMatch) && (hovered_line_ != selected_line_)) view_->InvalidateLine(hovered_line_); - // Change the hover to the new line and make sure it's redrawn. + // Change the hover to the new line. hovered_line_ = line; if (!is_disabling && (hovered_line_ != selected_line_)) view_->InvalidateLine(hovered_line_); - - if (is_enabling || is_disabling) - view_->OnHoverEnabledOrDisabled(is_disabling); } void AutocompletePopupModel::SetSelectedLine(size_t line, diff --git a/chrome/browser/autocomplete/autocomplete_popup_view.h b/chrome/browser/autocomplete/autocomplete_popup_view.h index 344ab9c..0dc8e35 100644 --- a/chrome/browser/autocomplete/autocomplete_popup_view.h +++ b/chrome/browser/autocomplete/autocomplete_popup_view.h @@ -51,9 +51,6 @@ class AutocompletePopupView { // mean opening or closing the window. virtual void UpdatePopupAppearance() = 0; - // Called by the model when hover is enabled or disabled. - virtual void OnHoverEnabledOrDisabled(bool disabled) = 0; - // Paint any pending updates. virtual void PaintUpdatesNow() = 0; diff --git a/chrome/browser/autocomplete/autocomplete_popup_view_gtk.cc b/chrome/browser/autocomplete/autocomplete_popup_view_gtk.cc index d197828..394077c 100644 --- a/chrome/browser/autocomplete/autocomplete_popup_view_gtk.cc +++ b/chrome/browser/autocomplete/autocomplete_popup_view_gtk.cc @@ -325,10 +325,6 @@ void AutocompletePopupViewGtk::UpdatePopupAppearance() { gtk_widget_queue_draw(window_); } -void AutocompletePopupViewGtk::OnHoverEnabledOrDisabled(bool disabled) { - NOTIMPLEMENTED(); -} - void AutocompletePopupViewGtk::PaintUpdatesNow() { // Paint our queued invalidations now, synchronously. gdk_window_process_updates(window_->window, FALSE); diff --git a/chrome/browser/autocomplete/autocomplete_popup_view_gtk.h b/chrome/browser/autocomplete/autocomplete_popup_view_gtk.h index b176348..4125791 100644 --- a/chrome/browser/autocomplete/autocomplete_popup_view_gtk.h +++ b/chrome/browser/autocomplete/autocomplete_popup_view_gtk.h @@ -30,7 +30,6 @@ class AutocompletePopupViewGtk : public AutocompletePopupView { virtual bool IsOpen() const { return opened_; } virtual void InvalidateLine(size_t line); virtual void UpdatePopupAppearance(); - virtual void OnHoverEnabledOrDisabled(bool disabled); virtual void PaintUpdatesNow(); virtual AutocompletePopupModel* GetModel(); diff --git a/chrome/browser/autocomplete/autocomplete_popup_view_mac.h b/chrome/browser/autocomplete/autocomplete_popup_view_mac.h index ef5a1f4..7840dfe 100644 --- a/chrome/browser/autocomplete/autocomplete_popup_view_mac.h +++ b/chrome/browser/autocomplete/autocomplete_popup_view_mac.h @@ -61,7 +61,6 @@ class AutocompletePopupViewMac : public AutocompletePopupView { // though. } virtual void UpdatePopupAppearance(); - virtual void OnHoverEnabledOrDisabled(bool disabled) { NOTIMPLEMENTED(); } // This is only called by model in SetSelectedLine() after updating // everything. Popup should already be visible. |