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

Side by Side Diff: ui/app_list/views/search_result_view.cc

Issue 1819753003: Allow various font weights in gfx. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add a lost comment and modify a render text unittest to not test black because of test env font con… 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 #include "ui/app_list/views/search_result_view.h" 5 #include "ui/app_list/views/search_result_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "ui/app_list/app_list_constants.h" 10 #include "ui/app_list/app_list_constants.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 render_text->SetColor(kResultDefaultTextColor); 50 render_text->SetColor(kResultDefaultTextColor);
51 51
52 for (SearchResult::Tags::const_iterator it = tags.begin(); 52 for (SearchResult::Tags::const_iterator it = tags.begin();
53 it != tags.end(); 53 it != tags.end();
54 ++it) { 54 ++it) {
55 // NONE means default style so do nothing. 55 // NONE means default style so do nothing.
56 if (it->styles == SearchResult::Tag::NONE) 56 if (it->styles == SearchResult::Tag::NONE)
57 continue; 57 continue;
58 58
59 if (it->styles & SearchResult::Tag::MATCH) 59 if (it->styles & SearchResult::Tag::MATCH)
60 render_text->ApplyStyle(gfx::BOLD, true, it->range); 60 render_text->ApplyWeight(gfx::Font::Weight::BOLD, it->range);
61 if (it->styles & SearchResult::Tag::DIM) 61 if (it->styles & SearchResult::Tag::DIM)
62 render_text->ApplyColor(kResultDimmedTextColor, it->range); 62 render_text->ApplyColor(kResultDimmedTextColor, it->range);
63 else if (it->styles & SearchResult::Tag::URL) 63 else if (it->styles & SearchResult::Tag::URL)
64 render_text->ApplyColor(kResultURLTextColor, it->range); 64 render_text->ApplyColor(kResultURLTextColor, it->range);
65 } 65 }
66 66
67 return render_text; 67 return render_text;
68 } 68 }
69 69
70 } // namespace 70 } // namespace
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after
416 if (context_menu_runner_->RunMenuAt(GetWidget(), 416 if (context_menu_runner_->RunMenuAt(GetWidget(),
417 NULL, 417 NULL,
418 gfx::Rect(point, gfx::Size()), 418 gfx::Rect(point, gfx::Size()),
419 views::MENU_ANCHOR_TOPLEFT, 419 views::MENU_ANCHOR_TOPLEFT,
420 source_type) == 420 source_type) ==
421 views::MenuRunner::MENU_DELETED) 421 views::MenuRunner::MENU_DELETED)
422 return; 422 return;
423 } 423 }
424 424
425 } // namespace app_list 425 } // namespace app_list
OLDNEW
« no previous file with comments | « content/browser/renderer_host/sandbox_ipc_linux.cc ('k') | ui/base/cocoa/menu_controller_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698