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

Unified Diff: chrome/browser/ui/views/autocomplete/autocomplete_result_view.h

Issue 10384007: First stab at touch optimized omnibox auto-complete per sgabriel's mocks. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review comments. Created 8 years, 7 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/autocomplete/autocomplete_result_view.h
diff --git a/chrome/browser/ui/views/autocomplete/autocomplete_result_view.h b/chrome/browser/ui/views/autocomplete/autocomplete_result_view.h
index 7d79dfde481b39f53735fe7111b72d6bccf1dac7..af8be2e4cf48098a7c415c508c750ba637e3a24c 100644
--- a/chrome/browser/ui/views/autocomplete/autocomplete_result_view.h
+++ b/chrome/browser/ui/views/autocomplete/autocomplete_result_view.h
@@ -60,10 +60,18 @@ class AutocompleteResultView : public views::View,
virtual gfx::Size GetPreferredSize() OVERRIDE;
protected:
+ ResultViewState GetState() const;
+
virtual void PaintMatch(gfx::Canvas* canvas,
const AutocompleteMatch& match,
int x);
+ // The base class never adjusts the bounds for the icon. Subclasses
+ // may adjust them e.g. if they are using a multi-line or horizontal
+ // layout.
+ virtual void AdjustIconBounds(const AutocompleteMatch& match,
+ gfx::Rect* bounds);
+
// Returns the height of the text portion of the result view. In the base
// class, this is the height of one line of text.
virtual int GetTextHeight() const;
@@ -81,6 +89,12 @@ class AutocompleteResultView : public views::View,
const gfx::Rect& text_bounds() const { return text_bounds_; }
+ void set_edge_item_padding(int value) { edge_item_padding_ = value; }
+ void set_item_padding(int value) { item_padding_ = value; }
+ void set_minimum_text_vertical_padding(int value) {
+ minimum_text_vertical_padding_ = value;
+ }
+
private:
struct ClassificationData;
typedef std::vector<ClassificationData> Classifications;
@@ -92,7 +106,6 @@ class AutocompleteResultView : public views::View,
static bool SortRunsLogically(const RunData& lhs, const RunData& rhs);
static bool SortRunsVisually(const RunData& lhs, const RunData& rhs);
- ResultViewState GetState() const;
const SkBitmap* GetIcon() const;
const SkBitmap* GetKeywordIcon() const;
@@ -122,6 +135,11 @@ class AutocompleteResultView : public views::View,
static int default_icon_size_;
+ // Default values cached here, may be overridden by subclasses.
+ int edge_item_padding_;
+ int item_padding_;
+ int minimum_text_vertical_padding_;
+
// This row's model and model index.
AutocompleteResultViewModel* model_;
size_t model_index_;

Powered by Google App Engine
This is Rietveld 408576698