Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2996)

Unified Diff: chrome/browser/ui/gtk/omnibox/omnibox_popup_view_gtk.h

Issue 22679003: InstantExtended(gtk): Hide top match if told to so. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Skip DCHECK in test. Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/gtk/omnibox/omnibox_popup_view_gtk.h
diff --git a/chrome/browser/ui/gtk/omnibox/omnibox_popup_view_gtk.h b/chrome/browser/ui/gtk/omnibox/omnibox_popup_view_gtk.h
index fcb6611d66fba2a7e8c02c7cfdc6e2c32c666629..66aa9dbb27a5160749d7f161f4688ca00bf89231 100644
--- a/chrome/browser/ui/gtk/omnibox/omnibox_popup_view_gtk.h
+++ b/chrome/browser/ui/gtk/omnibox/omnibox_popup_view_gtk.h
@@ -21,6 +21,7 @@
#include "ui/base/window_open_disposition.h"
#include "ui/gfx/font.h"
+class AutocompleteResult;
class GtkThemeService;
class OmniboxEditModel;
class OmniboxPopupModel;
@@ -40,6 +41,9 @@ class OmniboxPopupViewGtk : public OmniboxPopupView,
GtkWidget* location_bar);
virtual ~OmniboxPopupViewGtk();
+ // Initializes the view.
+ virtual void Init();
+
// Overridden from OmniboxPopupView:
virtual bool IsOpen() const OVERRIDE;
virtual void InvalidateLine(size_t line) OVERRIDE;
@@ -53,6 +57,23 @@ class OmniboxPopupViewGtk : public OmniboxPopupView,
const content::NotificationSource& source,
const content::NotificationDetails& details) OVERRIDE;
+ protected:
+ // Convert a y-coordinate to the closest line / result.
+ size_t LineFromY(int y) const;
+
+ // Return a Rect for the space for a result line. This excludes the border,
+ // but includes the padding. This is the area that is colored for a
+ // selection.
+ gfx::Rect GetRectForLine(size_t line, int width) const;
+
+ // Returns the number of hidden matches at the top of the popup. This is
+ // non-zero when a verbatim match like search-what-you-typed is present but
+ // should not be shown.
+ size_t GetHiddenMatchCount() const;
+
+ // Returns the current autocomplete result.
+ virtual const AutocompleteResult& GetResult() const;
+
private:
// Be friendly for unit tests.
friend class OmniboxPopupViewGtkTest;
@@ -66,18 +87,16 @@ class OmniboxPopupViewGtk : public OmniboxPopupView,
const GdkColor* url_color,
const std::string& prefix_text);
- void Show(size_t num_results);
- void Hide();
+ virtual void Show(size_t num_results);
+ virtual void Hide();
// Restack the popup window directly above the browser's toplevel window.
void StackWindow();
- // Convert a y-coordinate to the closest line / result.
- size_t LineFromY(int y);
-
// Accept a line of the results, for example, when the user clicks a line.
void AcceptLine(size_t line, WindowOpenDisposition disposition);
+ // Returns the appropriate icon to display beside |match|.
gfx::Image IconForMatch(const AutocompleteMatch& match,
bool selected,
bool is_selected_keyword);

Powered by Google App Engine
This is Rietveld 408576698