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

Side by Side Diff: ash/common/system/user/button_from_view.cc

Issue 2527513002: Update ash shelf/tray focus rects. (Closed)
Patch Set: rebase Created 4 years 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 | « ash/common/system/tray/tray_popup_utils.cc ('k') | ui/gfx/canvas.h » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 <vector> 5 #include <vector>
6 6
7 #include "ash/common/system/user/button_from_view.h" 7 #include "ash/common/system/user/button_from_view.h"
8 8
9 #include "ash/common/ash_constants.h" 9 #include "ash/common/ash_constants.h"
10 #include "ash/common/material_design/material_design_controller.h" 10 #include "ash/common/material_design/material_design_controller.h"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 82
83 void ButtonFromView::OnMouseExited(const ui::MouseEvent& event) { 83 void ButtonFromView::OnMouseExited(const ui::MouseEvent& event) {
84 button_hovered_ = false; 84 button_hovered_ = false;
85 ShowActive(); 85 ShowActive();
86 } 86 }
87 87
88 void ButtonFromView::OnPaint(gfx::Canvas* canvas) { 88 void ButtonFromView::OnPaint(gfx::Canvas* canvas) {
89 View::OnPaint(canvas); 89 View::OnPaint(canvas);
90 if (HasFocus()) { 90 if (HasFocus()) {
91 gfx::RectF rect(GetLocalBounds()); 91 gfx::RectF rect(GetLocalBounds());
92 if (MaterialDesignController::IsSystemTrayMenuMaterial()) 92 bool use_md = MaterialDesignController::IsSystemTrayMenuMaterial();
93 rect.Inset(gfx::InsetsF(0.5f)); 93 if (!use_md)
94 else
95 rect.Inset(gfx::InsetsF(tab_frame_inset_)); 94 rect.Inset(gfx::InsetsF(tab_frame_inset_));
96 canvas->DrawSolidFocusRect(rect, kFocusBorderColor); 95 canvas->DrawSolidFocusRect(rect, kFocusBorderColor,
96 use_md ? kFocusBorderThickness : 1);
97 } 97 }
98 } 98 }
99 99
100 void ButtonFromView::OnFocus() { 100 void ButtonFromView::OnFocus() {
101 View::OnFocus(); 101 View::OnFocus();
102 // Adding focus frame. 102 // Adding focus frame.
103 SchedulePaint(); 103 SchedulePaint();
104 } 104 }
105 105
106 void ButtonFromView::OnBlur() { 106 void ButtonFromView::OnBlur() {
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 button_hovered_ ? kHoverBackgroundColor : kBackgroundColor; 174 button_hovered_ ? kHoverBackgroundColor : kBackgroundColor;
175 content_->set_background( 175 content_->set_background(
176 views::Background::CreateSolidBackground(background_color)); 176 views::Background::CreateSolidBackground(background_color));
177 set_background(views::Background::CreateSolidBackground(background_color)); 177 set_background(views::Background::CreateSolidBackground(background_color));
178 } 178 }
179 SchedulePaint(); 179 SchedulePaint();
180 } 180 }
181 181
182 } // namespace tray 182 } // namespace tray
183 } // namespace ash 183 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/system/tray/tray_popup_utils.cc ('k') | ui/gfx/canvas.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698