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

Unified Diff: chrome/browser/ui/views/omnibox/omnibox_result_view.h

Issue 1399253005: Fix layout of omnibox rows for material design (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments addressed Created 5 years, 2 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/views/omnibox/omnibox_result_view.h
diff --git a/chrome/browser/ui/views/omnibox/omnibox_result_view.h b/chrome/browser/ui/views/omnibox/omnibox_result_view.h
index b79ce29821f04aa9971d0491f8f06095dc802e5c..c9b45dd2ae41b14faa503b6c1b82be2da8a3609c 100644
--- a/chrome/browser/ui/views/omnibox/omnibox_result_view.h
+++ b/chrome/browser/ui/views/omnibox/omnibox_result_view.h
@@ -83,6 +83,13 @@ class OmniboxResultView : public views::View,
void SetAnswerImage(const gfx::ImageSkia& image);
protected:
+ enum RenderTextType {
+ CONTENTS = 0,
+ SEPARATOR,
+ DESCRIPTION,
+ NUM_TYPES
+ };
+
// Paints the given |match| using the RenderText instances |contents| and
// |description| at offset |x| in the bounds of this view.
virtual void PaintMatch(const AutocompleteMatch& match,
@@ -92,14 +99,14 @@ class OmniboxResultView : public views::View,
int x) const;
// Draws given |render_text| on |canvas| at given location (|x|, |y|).
- // |contents| indicates whether the |render_text| is for the match contents
- // (rather than the separator or the description). Additional properties from
- // |match| are used to render Infinite suggestions correctly. If |max_width|
- // is a non-negative number, the text will be elided to fit within
- // |max_width|. Returns the x position to the right of the string.
+ // |contents| indicates if the |render_text| is for the match contents,
+ // separator, or description. Additional properties from |match| are used to
+ // render Infinite suggestions correctly. If |max_width| is a non-negative
+ // number, the text will be elided to fit within |max_width|. Returns the x
+ // position to the right of the string.
int DrawRenderText(const AutocompleteMatch& match,
gfx::RenderText* render_text,
- bool contents,
+ RenderTextType render_text_type,
gfx::Canvas* canvas,
int x,
int y,
« no previous file with comments | « chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.cc ('k') | chrome/browser/ui/views/omnibox/omnibox_result_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698