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

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

Issue 2009673005: AiS: Have Omnibox definitions use new multi-line elision in RenderText (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Streamlined RenderTexts Created 4 years, 6 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 <stddef.h> 8 #include <stddef.h>
9 9
10 #include <vector> 10 #include <vector>
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 int GetDisplayOffset(const AutocompleteMatch& match, 164 int GetDisplayOffset(const AutocompleteMatch& match,
165 bool is_ui_rtl, 165 bool is_ui_rtl,
166 bool is_match_contents_rtl) const; 166 bool is_match_contents_rtl) const;
167 167
168 int GetAnswerLineHeight() const; 168 int GetAnswerLineHeight() const;
169 int GetContentLineHeight() const; 169 int GetContentLineHeight() const;
170 170
171 // Creates a RenderText with text and styling from the image line. 171 // Creates a RenderText with text and styling from the image line.
172 std::unique_ptr<gfx::RenderText> CreateAnswerLine( 172 std::unique_ptr<gfx::RenderText> CreateAnswerLine(
173 const SuggestionAnswer::ImageLine& line, 173 const SuggestionAnswer::ImageLine& line,
174 gfx::FontList font_list); 174 gfx::FontList font_list) const;
175 175
176 // Adds |text| to |destination|. |text_type| is an index into the 176 // Adds |text| to |destination|. |text_type| is an index into the
177 // kTextStyles constant defined in the .cc file and is used to style the text, 177 // kTextStyles constant defined in the .cc file and is used to style the text,
178 // including setting the font size, color, and baseline style. See the 178 // including setting the font size, color, and baseline style. See the
179 // TextStyle struct in the .cc file for more. 179 // TextStyle struct in the .cc file for more.
180 void AppendAnswerText(gfx::RenderText* destination, 180 void AppendAnswerText(gfx::RenderText* destination,
181 const base::string16& text, 181 const base::string16& text,
182 int text_type); 182 int text_type) const;
183 183
184 // AppendAnswerText will break up the |text| into bold and non-bold pieces 184 // 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. 185 // and pass each to this helper with the correct |is_bold| value.
186 void AppendAnswerTextHelper(gfx::RenderText* destination, 186 void AppendAnswerTextHelper(gfx::RenderText* destination,
187 const base::string16& text, 187 const base::string16& text,
188 int text_type, 188 int text_type,
189 bool is_bold); 189 bool is_bold) const;
190 190
191 // Returns the necessary margin, if any, at the start and end of the view. 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 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() 193 // location bar contents. For a left-to-right language, StartMargin()
194 // and EndMargin() correspond to the left and right margins, respectively. 194 // and EndMargin() correspond to the left and right margins, respectively.
195 int StartMargin() const; 195 int StartMargin() const;
196 int EndMargin() const; 196 int EndMargin() const;
197 197
198 static int default_icon_size_; 198 static int default_icon_size_;
199 199
(...skipping 30 matching lines...) Expand all
230 mutable std::unique_ptr<gfx::RenderText> separator_rendertext_; 230 mutable std::unique_ptr<gfx::RenderText> separator_rendertext_;
231 mutable std::unique_ptr<gfx::RenderText> keyword_contents_rendertext_; 231 mutable std::unique_ptr<gfx::RenderText> keyword_contents_rendertext_;
232 mutable std::unique_ptr<gfx::RenderText> keyword_description_rendertext_; 232 mutable std::unique_ptr<gfx::RenderText> keyword_description_rendertext_;
233 233
234 mutable int separator_width_; 234 mutable int separator_width_;
235 235
236 DISALLOW_COPY_AND_ASSIGN(OmniboxResultView); 236 DISALLOW_COPY_AND_ASSIGN(OmniboxResultView);
237 }; 237 };
238 238
239 #endif // CHROME_BROWSER_UI_VIEWS_OMNIBOX_OMNIBOX_RESULT_VIEW_H_ 239 #endif // CHROME_BROWSER_UI_VIEWS_OMNIBOX_OMNIBOX_RESULT_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698