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

Side by Side Diff: chrome/browser/ui/views/omnibox/omnibox_result_view.h

Issue 795933009: [AiS] for desktop, two lines and font sytles (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Increase vertical spacing in suggestions Created 5 years, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_UI_VIEWS_OMNIBOX_OMNIBOX_RESULT_VIEW_H_ 5 #ifndef CHROME_BROWSER_UI_VIEWS_OMNIBOX_OMNIBOX_RESULT_VIEW_H_
6 #define CHROME_BROWSER_UI_VIEWS_OMNIBOX_OMNIBOX_RESULT_VIEW_H_ 6 #define CHROME_BROWSER_UI_VIEWS_OMNIBOX_OMNIBOX_RESULT_VIEW_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/gtest_prod_util.h" 10 #include "base/gtest_prod_util.h"
11 #include "chrome/browser/bitmap_fetcher/bitmap_fetcher_service.h" 11 #include "chrome/browser/bitmap_fetcher/bitmap_fetcher_service.h"
12 #include "components/omnibox/autocomplete_match.h" 12 #include "components/omnibox/autocomplete_match.h"
13 #include "components/omnibox/suggestion_answer.h"
Justin Donnelly 2015/03/13 21:08:33 You can just forward declare this, no?
dschuyler 2015/03/13 21:48:23 It's a nested class. I think that's not doable (u
13 #include "third_party/skia/include/core/SkColor.h" 14 #include "third_party/skia/include/core/SkColor.h"
14 #include "ui/gfx/animation/animation_delegate.h" 15 #include "ui/gfx/animation/animation_delegate.h"
15 #include "ui/gfx/animation/slide_animation.h" 16 #include "ui/gfx/animation/slide_animation.h"
16 #include "ui/gfx/font_list.h" 17 #include "ui/gfx/font_list.h"
17 #include "ui/gfx/geometry/rect.h" 18 #include "ui/gfx/geometry/rect.h"
18 #include "ui/views/controls/image_view.h" 19 #include "ui/views/controls/image_view.h"
19 #include "ui/views/view.h" 20 #include "ui/views/view.h"
20 21
21 class LocationBarView; 22 class LocationBarView;
22 class OmniboxPopupContentsView; 23 class OmniboxPopupContentsView;
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 70
70 ResultViewState GetState() const; 71 ResultViewState GetState() const;
71 72
72 // Returns the height of the text portion of the result view. In the base 73 // Returns the height of the text portion of the result view. In the base
73 // class, this is the height of one line of text. 74 // class, this is the height of one line of text.
74 virtual int GetTextHeight() const; 75 virtual int GetTextHeight() const;
75 76
76 // Returns the display width required for the match contents. 77 // Returns the display width required for the match contents.
77 int GetMatchContentsWidth() const; 78 int GetMatchContentsWidth() const;
78 79
80 int get_minimum_text_vertical_padding() const {
81 return minimum_text_vertical_padding_;
82 }
83
79 // Stores the image in a local data member and schedules a repaint. 84 // Stores the image in a local data member and schedules a repaint.
80 void SetAnswerImage(const gfx::ImageSkia& image); 85 void SetAnswerImage(const gfx::ImageSkia& image);
81 86
82 protected: 87 protected:
83 // Paints the given |match| using the RenderText instances |contents| and 88 // Paints the given |match| using the RenderText instances |contents| and
84 // |description| at offset |x| in the bounds of this view. 89 // |description| at offset |x| in the bounds of this view.
85 virtual void PaintMatch(const AutocompleteMatch& match, 90 virtual void PaintMatch(const AutocompleteMatch& match,
86 gfx::RenderText* contents, 91 gfx::RenderText* contents,
87 gfx::RenderText* description, 92 gfx::RenderText* description,
88 gfx::Canvas* canvas, 93 gfx::Canvas* canvas,
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 // gfx::AnimationDelegate: 153 // gfx::AnimationDelegate:
149 void AnimationProgressed(const gfx::Animation* animation) override; 154 void AnimationProgressed(const gfx::Animation* animation) override;
150 155
151 // Returns the offset at which the contents of the |match| should be displayed 156 // Returns the offset at which the contents of the |match| should be displayed
152 // within the text bounds. The directionality of UI and match contents is used 157 // within the text bounds. The directionality of UI and match contents is used
153 // to determine the offset relative to the correct edge. 158 // to determine the offset relative to the correct edge.
154 int GetDisplayOffset(const AutocompleteMatch& match, 159 int GetDisplayOffset(const AutocompleteMatch& match,
155 bool is_ui_rtl, 160 bool is_ui_rtl,
156 bool is_match_contents_rtl) const; 161 bool is_match_contents_rtl) const;
157 162
163 int StyleAnswerText(gfx::RenderText* render_text,
164 int offset,
165 const SuggestionAnswer::TextField& text_field) const;
166
167 int GetContentLineHeight() const;
168
158 static int default_icon_size_; 169 static int default_icon_size_;
159 170
160 // Default values cached here, may be overridden using the setters above. 171 // Default values cached here, may be overridden using the setters above.
161 int edge_item_padding_; 172 int edge_item_padding_;
162 int item_padding_; 173 int item_padding_;
163 int minimum_text_vertical_padding_; 174 int minimum_text_vertical_padding_;
164 175
165 // This row's model and model index. 176 // This row's model and model index.
166 OmniboxPopupContentsView* model_; 177 OmniboxPopupContentsView* model_;
167 size_t model_index_; 178 size_t model_index_;
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 mutable scoped_ptr<gfx::RenderText> keyword_description_rendertext_; 212 mutable scoped_ptr<gfx::RenderText> keyword_description_rendertext_;
202 213
203 mutable int separator_width_; 214 mutable int separator_width_;
204 215
205 base::WeakPtrFactory<OmniboxResultView> weak_ptr_factory_; 216 base::WeakPtrFactory<OmniboxResultView> weak_ptr_factory_;
206 217
207 DISALLOW_COPY_AND_ASSIGN(OmniboxResultView); 218 DISALLOW_COPY_AND_ASSIGN(OmniboxResultView);
208 }; 219 };
209 220
210 #endif // CHROME_BROWSER_UI_VIEWS_OMNIBOX_OMNIBOX_RESULT_VIEW_H_ 221 #endif // CHROME_BROWSER_UI_VIEWS_OMNIBOX_OMNIBOX_RESULT_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698