OLD | NEW |
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" | |
14 #include "third_party/skia/include/core/SkColor.h" | 13 #include "third_party/skia/include/core/SkColor.h" |
15 #include "ui/gfx/animation/animation_delegate.h" | 14 #include "ui/gfx/animation/animation_delegate.h" |
16 #include "ui/gfx/animation/slide_animation.h" | 15 #include "ui/gfx/animation/slide_animation.h" |
17 #include "ui/gfx/font_list.h" | 16 #include "ui/gfx/font_list.h" |
18 #include "ui/gfx/geometry/rect.h" | 17 #include "ui/gfx/geometry/rect.h" |
19 #include "ui/views/controls/image_view.h" | 18 #include "ui/views/controls/image_view.h" |
20 #include "ui/views/view.h" | 19 #include "ui/views/view.h" |
21 | 20 |
22 class LocationBarView; | 21 class LocationBarView; |
23 class OmniboxPopupContentsView; | 22 class OmniboxPopupContentsView; |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 // Returns the offset at which the contents of the |match| should be displayed | 152 // Returns the offset at which the contents of the |match| should be displayed |
154 // within the text bounds. The directionality of UI and match contents is used | 153 // within the text bounds. The directionality of UI and match contents is used |
155 // to determine the offset relative to the correct edge. | 154 // to determine the offset relative to the correct edge. |
156 int GetDisplayOffset(const AutocompleteMatch& match, | 155 int GetDisplayOffset(const AutocompleteMatch& match, |
157 bool is_ui_rtl, | 156 bool is_ui_rtl, |
158 bool is_match_contents_rtl) const; | 157 bool is_match_contents_rtl) const; |
159 | 158 |
160 int GetAnswerLineHeight() const; | 159 int GetAnswerLineHeight() const; |
161 int GetContentLineHeight() const; | 160 int GetContentLineHeight() const; |
162 | 161 |
163 void AppendAnswerText(const SuggestionAnswer::TextField& text_field); | 162 // Adds |text| to |description_rendertext_|. |text_type| is an index into the |
| 163 // kTextStyles constant defined in the .cc file and is used to style the text, |
| 164 // including setting the font size, color, and baseline style. See the |
| 165 // TextStyle struct in the .cc file for more. |
| 166 void AppendAnswerText(const base::string16& text, int text_type); |
164 | 167 |
165 static int default_icon_size_; | 168 static int default_icon_size_; |
166 | 169 |
167 // Default values cached here, may be overridden using the setters above. | 170 // Default values cached here, may be overridden using the setters above. |
168 int edge_item_padding_; | 171 int edge_item_padding_; |
169 int item_padding_; | 172 int item_padding_; |
170 | 173 |
171 // This row's model and model index. | 174 // This row's model and model index. |
172 OmniboxPopupContentsView* model_; | 175 OmniboxPopupContentsView* model_; |
173 size_t model_index_; | 176 size_t model_index_; |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 mutable scoped_ptr<gfx::RenderText> keyword_description_rendertext_; | 210 mutable scoped_ptr<gfx::RenderText> keyword_description_rendertext_; |
208 | 211 |
209 mutable int separator_width_; | 212 mutable int separator_width_; |
210 | 213 |
211 base::WeakPtrFactory<OmniboxResultView> weak_ptr_factory_; | 214 base::WeakPtrFactory<OmniboxResultView> weak_ptr_factory_; |
212 | 215 |
213 DISALLOW_COPY_AND_ASSIGN(OmniboxResultView); | 216 DISALLOW_COPY_AND_ASSIGN(OmniboxResultView); |
214 }; | 217 }; |
215 | 218 |
216 #endif // CHROME_BROWSER_UI_VIEWS_OMNIBOX_OMNIBOX_RESULT_VIEW_H_ | 219 #endif // CHROME_BROWSER_UI_VIEWS_OMNIBOX_OMNIBOX_RESULT_VIEW_H_ |
OLD | NEW |