| 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 <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 gfx::ImageSkia GetKeywordIcon() const; | 136 gfx::ImageSkia GetKeywordIcon() const; |
| 137 | 137 |
| 138 // Utility function for creating vector icons. | 138 // Utility function for creating vector icons. |
| 139 gfx::ImageSkia GetVectorIcon(gfx::VectorIconId icon_id) const; | 139 gfx::ImageSkia GetVectorIcon(gfx::VectorIconId icon_id) const; |
| 140 | 140 |
| 141 // Whether to render only the keyword match. Returns true if |match_| has an | 141 // Whether to render only the keyword match. Returns true if |match_| has an |
| 142 // associated keyword match that has been animated so close to the start that | 142 // associated keyword match that has been animated so close to the start that |
| 143 // the keyword match will hide even the icon of the regular match. | 143 // the keyword match will hide even the icon of the regular match. |
| 144 bool ShowOnlyKeywordMatch() const; | 144 bool ShowOnlyKeywordMatch() const; |
| 145 | 145 |
| 146 // Resets all RenderTexts for contents and description of the |match_| and its | |
| 147 // associated keyword match. | |
| 148 void ResetRenderTexts() const; | |
| 149 | |
| 150 // Initializes |contents_rendertext_| if it is NULL. | 146 // Initializes |contents_rendertext_| if it is NULL. |
| 151 void InitContentsRenderTextIfNecessary() const; | 147 void InitContentsRenderTextIfNecessary() const; |
| 152 | 148 |
| 153 // views::View: | 149 // views::View: |
| 154 void Layout() override; | 150 void Layout() override; |
| 155 void OnBoundsChanged(const gfx::Rect& previous_bounds) override; | 151 void OnBoundsChanged(const gfx::Rect& previous_bounds) override; |
| 156 void OnPaint(gfx::Canvas* canvas) override; | 152 void OnPaint(gfx::Canvas* canvas) override; |
| 157 | 153 |
| 158 // gfx::AnimationDelegate: | 154 // gfx::AnimationDelegate: |
| 159 void AnimationProgressed(const gfx::Animation* animation) override; | 155 void AnimationProgressed(const gfx::Animation* animation) override; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 181 const base::string16& text, | 177 const base::string16& text, |
| 182 int text_type) const; | 178 int text_type) const; |
| 183 | 179 |
| 184 // AppendAnswerText will break up the |text| into bold and non-bold pieces | 180 // AppendAnswerText will break up the |text| into bold and non-bold pieces |
| 185 // and pass each to this helper with the correct |is_bold| value. | 181 // and pass each to this helper with the correct |is_bold| value. |
| 186 void AppendAnswerTextHelper(gfx::RenderText* destination, | 182 void AppendAnswerTextHelper(gfx::RenderText* destination, |
| 187 const base::string16& text, | 183 const base::string16& text, |
| 188 int text_type, | 184 int text_type, |
| 189 bool is_bold) const; | 185 bool is_bold) const; |
| 190 | 186 |
| 191 // Returns the necessary margin, if any, at the start and end of the view. | |
| 192 // This allows us to keep the icon and text in the view aligned with the | |
| 193 // location bar contents. For a left-to-right language, StartMargin() | |
| 194 // and EndMargin() correspond to the left and right margins, respectively. | |
| 195 int StartMargin() const; | |
| 196 int EndMargin() const; | |
| 197 | |
| 198 static int default_icon_size_; | 187 static int default_icon_size_; |
| 199 | 188 |
| 200 // This row's model and model index. | 189 // This row's model and model index. |
| 201 OmniboxPopupContentsView* model_; | 190 OmniboxPopupContentsView* model_; |
| 202 size_t model_index_; | 191 size_t model_index_; |
| 203 | 192 |
| 204 LocationBarView* location_bar_view_; | 193 LocationBarView* location_bar_view_; |
| 205 | 194 |
| 206 const gfx::FontList font_list_; | 195 const gfx::FontList font_list_; |
| 207 int font_height_; | 196 int font_height_; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 230 mutable std::unique_ptr<gfx::RenderText> separator_rendertext_; | 219 mutable std::unique_ptr<gfx::RenderText> separator_rendertext_; |
| 231 mutable std::unique_ptr<gfx::RenderText> keyword_contents_rendertext_; | 220 mutable std::unique_ptr<gfx::RenderText> keyword_contents_rendertext_; |
| 232 mutable std::unique_ptr<gfx::RenderText> keyword_description_rendertext_; | 221 mutable std::unique_ptr<gfx::RenderText> keyword_description_rendertext_; |
| 233 | 222 |
| 234 mutable int separator_width_; | 223 mutable int separator_width_; |
| 235 | 224 |
| 236 DISALLOW_COPY_AND_ASSIGN(OmniboxResultView); | 225 DISALLOW_COPY_AND_ASSIGN(OmniboxResultView); |
| 237 }; | 226 }; |
| 238 | 227 |
| 239 #endif // CHROME_BROWSER_UI_VIEWS_OMNIBOX_OMNIBOX_RESULT_VIEW_H_ | 228 #endif // CHROME_BROWSER_UI_VIEWS_OMNIBOX_OMNIBOX_RESULT_VIEW_H_ |
| OLD | NEW |