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

Side by Side Diff: ash/common/system/tray/actionable_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/shelf/shelf_button.cc ('k') | ash/common/system/tray/system_menu_button.cc » ('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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 "ash/common/system/tray/actionable_view.h" 5 #include "ash/common/system/tray/actionable_view.h"
6 6
7 #include "ash/common/ash_constants.h" 7 #include "ash/common/ash_constants.h"
8 #include "ash/common/system/tray/system_tray.h" 8 #include "ash/common/system/tray/system_tray.h"
9 #include "ash/common/system/tray/system_tray_item.h" 9 #include "ash/common/system/tray/system_tray_item.h"
10 #include "ash/common/system/tray/tray_constants.h" 10 #include "ash/common/system/tray/tray_constants.h"
(...skipping 24 matching lines...) Expand all
35 set_has_ink_drop_action_on_click(false); 35 set_has_ink_drop_action_on_click(false);
36 set_notify_enter_exit_on_child(true); 36 set_notify_enter_exit_on_child(true);
37 } 37 }
38 38
39 ActionableView::~ActionableView() { 39 ActionableView::~ActionableView() {
40 if (destroyed_) 40 if (destroyed_)
41 *destroyed_ = true; 41 *destroyed_ = true;
42 } 42 }
43 43
44 void ActionableView::OnPaintFocus(gfx::Canvas* canvas) { 44 void ActionableView::OnPaintFocus(gfx::Canvas* canvas) {
45 gfx::Rect rect(GetFocusBounds()); 45 gfx::RectF rect(GetFocusBounds());
46 rect.Inset(1, 1, 3, 2); 46 canvas->DrawSolidFocusRect(rect, kFocusBorderColor, kFocusBorderThickness);
47 canvas->DrawSolidFocusRect(rect, kFocusBorderColor);
48 } 47 }
49 48
50 gfx::Rect ActionableView::GetFocusBounds() { 49 gfx::Rect ActionableView::GetFocusBounds() {
51 return GetLocalBounds(); 50 return GetLocalBounds();
52 } 51 }
53 52
54 void ActionableView::HandlePerformActionResult(bool action_performed, 53 void ActionableView::HandlePerformActionResult(bool action_performed,
55 const ui::Event& event) { 54 const ui::Event& event) {
56 AnimateInkDrop(action_performed ? views::InkDropState::ACTION_TRIGGERED 55 AnimateInkDrop(action_performed ? views::InkDropState::ACTION_TRIGGERED
57 : views::InkDropState::HIDDEN, 56 : views::InkDropState::HIDDEN,
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 TrayPopupInkDropStyle ink_drop_style, 136 TrayPopupInkDropStyle ink_drop_style,
138 views::ButtonListener* listener) 137 views::ButtonListener* listener)
139 : ActionableView(owner, ink_drop_style), listener_(listener) {} 138 : ActionableView(owner, ink_drop_style), listener_(listener) {}
140 139
141 bool ButtonListenerActionableView::PerformAction(const ui::Event& event) { 140 bool ButtonListenerActionableView::PerformAction(const ui::Event& event) {
142 listener_->ButtonPressed(this, event); 141 listener_->ButtonPressed(this, event);
143 return true; 142 return true;
144 } 143 }
145 144
146 } // namespace ash 145 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/shelf/shelf_button.cc ('k') | ash/common/system/tray/system_menu_button.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698