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

Side by Side Diff: chrome/browser/ui/views/desktop_capture/desktop_media_source_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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "chrome/browser/ui/views/desktop_capture/desktop_media_source_view.h" 5 #include "chrome/browser/ui/views/desktop_capture/desktop_media_source_view.h"
6 6
7 #include "chrome/browser/media/desktop_media_list.h" 7 #include "chrome/browser/media/desktop_media_list.h"
8 #include "chrome/browser/ui/views/desktop_capture/desktop_media_list_view.h" 8 #include "chrome/browser/ui/views/desktop_capture/desktop_media_list_view.h"
9 #include "chrome/browser/ui/views/desktop_capture/desktop_media_picker_views.h" 9 #include "chrome/browser/ui/views/desktop_capture/desktop_media_picker_views.h"
10 #include "ui/gfx/canvas.h" 10 #include "ui/gfx/canvas.h"
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 DesktopMediaSourceView* source_view = 81 DesktopMediaSourceView* source_view =
82 static_cast<DesktopMediaSourceView*>(*i); 82 static_cast<DesktopMediaSourceView*>(*i);
83 source_view->SetSelected(false); 83 source_view->SetSelected(false);
84 } 84 }
85 } 85 }
86 86
87 const SkColor border_color = GetNativeTheme()->GetSystemColor( 87 const SkColor border_color = GetNativeTheme()->GetSystemColor(
88 ui::NativeTheme::kColorId_FocusedMenuItemBackgroundColor); 88 ui::NativeTheme::kColorId_FocusedMenuItemBackgroundColor);
89 image_view_->SetBorder(views::Border::CreateSolidBorder( 89 image_view_->SetBorder(views::Border::CreateSolidBorder(
90 style_.selection_border_thickness, border_color)); 90 style_.selection_border_thickness, border_color));
91 label_->SetFontList(label_->font_list().Derive(0, gfx::Font::BOLD)); 91 label_->SetFontList(label_->font_list().Derive(0, gfx::Font::NORMAL,
92 gfx::Font::Weight::BOLD));
92 parent_->OnSelectionChanged(); 93 parent_->OnSelectionChanged();
93 } else { 94 } else {
94 image_view_->SetBorder(views::Border::NullBorder()); 95 image_view_->SetBorder(views::Border::NullBorder());
95 label_->SetFontList(label_->font_list().Derive(0, gfx::Font::NORMAL)); 96 label_->SetFontList(label_->font_list().Derive(0, gfx::Font::NORMAL,
97 gfx::Font::Weight::NORMAL));
96 } 98 }
97 99
98 SchedulePaint(); 100 SchedulePaint();
99 } 101 }
100 102
101 void DesktopMediaSourceView::SetHovered(bool hovered) { 103 void DesktopMediaSourceView::SetHovered(bool hovered) {
102 if (hovered) { 104 if (hovered) {
103 // Use background color to show mouse hover. 105 // Use background color to show mouse hover.
104 const SkColor bg_color = GetNativeTheme()->GetSystemColor( 106 const SkColor bg_color = GetNativeTheme()->GetSystemColor(
105 ui::NativeTheme::kColorId_HoverMenuItemBackgroundColor); 107 ui::NativeTheme::kColorId_HoverMenuItemBackgroundColor);
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 return; 201 return;
200 } 202 }
201 203
202 // Detect tap gesture using ET_GESTURE_TAP_DOWN so the view also gets focused 204 // Detect tap gesture using ET_GESTURE_TAP_DOWN so the view also gets focused
203 // on the long tap (when the tap gesture starts). 205 // on the long tap (when the tap gesture starts).
204 if (event->type() == ui::ET_GESTURE_TAP_DOWN) { 206 if (event->type() == ui::ET_GESTURE_TAP_DOWN) {
205 RequestFocus(); 207 RequestFocus();
206 event->SetHandled(); 208 event->SetHandled();
207 } 209 }
208 } 210 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/autofill/password_generation_popup_view_views.cc ('k') | chrome/browser/ui/views/first_run_bubble.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698