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

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

Issue 2671323003: Fix the size of omnibox suggestion answers. (Closed)
Patch Set: Created 3 years, 10 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
« no previous file with comments | « no previous file | chrome/browser/ui/views/omnibox/omnibox_result_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <stddef.h> 8 #include <stddef.h>
9 9
10 #include <vector> 10 #include <vector>
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 // gfx::AnimationDelegate: 151 // gfx::AnimationDelegate:
152 void AnimationProgressed(const gfx::Animation* animation) override; 152 void AnimationProgressed(const gfx::Animation* animation) override;
153 153
154 // Returns the offset at which the contents of the |match| should be displayed 154 // Returns the offset at which the contents of the |match| should be displayed
155 // within the text bounds. The directionality of UI and match contents is used 155 // within the text bounds. The directionality of UI and match contents is used
156 // to determine the offset relative to the correct edge. 156 // to determine the offset relative to the correct edge.
157 int GetDisplayOffset(const AutocompleteMatch& match, 157 int GetDisplayOffset(const AutocompleteMatch& match,
158 bool is_ui_rtl, 158 bool is_ui_rtl,
159 bool is_match_contents_rtl) const; 159 bool is_match_contents_rtl) const;
160 160
161 // Returns the font to use for the description line of answer suggestions.
162 const gfx::FontList& GetAnswerLineFont() const;
163
164 // Returns the height of the the description line of answer suggestions.
161 int GetAnswerLineHeight() const; 165 int GetAnswerLineHeight() const;
166
167 // Returns the height of the content line.
162 int GetContentLineHeight() const; 168 int GetContentLineHeight() const;
163 169
164 // Creates a RenderText with text and styling from the image line. 170 // Creates a RenderText with text and styling from the image line.
165 std::unique_ptr<gfx::RenderText> CreateAnswerLine( 171 std::unique_ptr<gfx::RenderText> CreateAnswerLine(
166 const SuggestionAnswer::ImageLine& line, 172 const SuggestionAnswer::ImageLine& line,
167 gfx::FontList font_list) const; 173 const gfx::FontList& font_list) const;
168 174
169 // Adds |text| to |destination|. |text_type| is an index into the 175 // Adds |text| to |destination|. |text_type| is an index into the
170 // kTextStyles constant defined in the .cc file and is used to style the text, 176 // kTextStyles constant defined in the .cc file and is used to style the text,
171 // including setting the font size, color, and baseline style. See the 177 // including setting the font size, color, and baseline style. See the
172 // TextStyle struct in the .cc file for more. 178 // TextStyle struct in the .cc file for more.
173 void AppendAnswerText(gfx::RenderText* destination, 179 void AppendAnswerText(gfx::RenderText* destination,
174 const base::string16& text, 180 const base::string16& text,
175 int text_type) const; 181 int text_type) const;
176 182
177 // AppendAnswerText will break up the |text| into bold and non-bold pieces 183 // AppendAnswerText will break up the |text| into bold and non-bold pieces
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 mutable std::unique_ptr<gfx::RenderText> separator_rendertext_; 218 mutable std::unique_ptr<gfx::RenderText> separator_rendertext_;
213 mutable std::unique_ptr<gfx::RenderText> keyword_contents_rendertext_; 219 mutable std::unique_ptr<gfx::RenderText> keyword_contents_rendertext_;
214 mutable std::unique_ptr<gfx::RenderText> keyword_description_rendertext_; 220 mutable std::unique_ptr<gfx::RenderText> keyword_description_rendertext_;
215 221
216 mutable int separator_width_; 222 mutable int separator_width_;
217 223
218 DISALLOW_COPY_AND_ASSIGN(OmniboxResultView); 224 DISALLOW_COPY_AND_ASSIGN(OmniboxResultView);
219 }; 225 };
220 226
221 #endif // CHROME_BROWSER_UI_VIEWS_OMNIBOX_OMNIBOX_RESULT_VIEW_H_ 227 #endif // CHROME_BROWSER_UI_VIEWS_OMNIBOX_OMNIBOX_RESULT_VIEW_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/views/omnibox/omnibox_result_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698