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

Unified Diff: ui/app_list/views/search_result_view.cc

Issue 11535014: Replace StyleRange with BreakList; update RenderText, etc. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments. Created 7 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/views/omnibox/touch_omnibox_popup_contents_view.cc ('k') | ui/gfx/break_list.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/app_list/views/search_result_view.cc
diff --git a/ui/app_list/views/search_result_view.cc b/ui/app_list/views/search_result_view.cc
index 47b98250e5bf77cddf33c9359760509095be0991..85caf5482580aef5fa8ff1a7012fc7eb415a6e71 100644
--- a/ui/app_list/views/search_result_view.cc
+++ b/ui/app_list/views/search_result_view.cc
@@ -64,11 +64,7 @@ gfx::RenderText* CreateRenderText(const string16& text,
const app_list::SearchResult::Tags& tags) {
gfx::RenderText* render_text = gfx::RenderText::CreateInstance();
render_text->SetText(text);
-
- gfx::StyleRange default_style;
- default_style.foreground = kDefaultTextColor;
- render_text->set_default_style(default_style);
- render_text->ApplyDefaultStyle();
+ render_text->SetColor(kDefaultTextColor);
for (app_list::SearchResult::Tags::const_iterator it = tags.begin();
it != tags.end();
@@ -77,17 +73,12 @@ gfx::RenderText* CreateRenderText(const string16& text,
if (it->styles == app_list::SearchResult::Tag::NONE)
continue;
- gfx::StyleRange style;
- style.range = it->range;
-
if (it->styles & app_list::SearchResult::Tag::MATCH)
- style.font_style = gfx::Font::BOLD;
- if (it->styles & app_list::SearchResult::Tag::URL)
- style.foreground = kURLTextColor;
+ render_text->ApplyStyle(gfx::BOLD, true, it->range);
if (it->styles & app_list::SearchResult::Tag::DIM)
- style.foreground = kDimmedTextColor;
-
- render_text->ApplyStyleRange(style);
+ render_text->ApplyColor(kDimmedTextColor, it->range);
+ else if (it->styles & app_list::SearchResult::Tag::URL)
+ render_text->ApplyColor(kURLTextColor, it->range);
}
return render_text;
« no previous file with comments | « chrome/browser/ui/views/omnibox/touch_omnibox_popup_contents_view.cc ('k') | ui/gfx/break_list.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698