| OLD | NEW |
| 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 Loading... |
| 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::RectF rect(GetFocusBounds()); | 45 gfx::RectF rect(GetLocalBounds()); |
| 46 canvas->DrawSolidFocusRect(rect, kFocusBorderColor, kFocusBorderThickness); | 46 canvas->DrawSolidFocusRect(rect, kFocusBorderColor, kFocusBorderThickness); |
| 47 } | 47 } |
| 48 | 48 |
| 49 gfx::Rect ActionableView::GetFocusBounds() { | |
| 50 return GetLocalBounds(); | |
| 51 } | |
| 52 | |
| 53 void ActionableView::HandlePerformActionResult(bool action_performed, | 49 void ActionableView::HandlePerformActionResult(bool action_performed, |
| 54 const ui::Event& event) { | 50 const ui::Event& event) { |
| 55 AnimateInkDrop(action_performed ? views::InkDropState::ACTION_TRIGGERED | 51 AnimateInkDrop(action_performed ? views::InkDropState::ACTION_TRIGGERED |
| 56 : views::InkDropState::HIDDEN, | 52 : views::InkDropState::HIDDEN, |
| 57 ui::LocatedEvent::FromIfValid(&event)); | 53 ui::LocatedEvent::FromIfValid(&event)); |
| 58 } | 54 } |
| 59 | 55 |
| 60 const char* ActionableView::GetClassName() const { | 56 const char* ActionableView::GetClassName() const { |
| 61 return kViewClassName; | 57 return kViewClassName; |
| 62 } | 58 } |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 TrayPopupInkDropStyle ink_drop_style, | 132 TrayPopupInkDropStyle ink_drop_style, |
| 137 views::ButtonListener* listener) | 133 views::ButtonListener* listener) |
| 138 : ActionableView(owner, ink_drop_style), listener_(listener) {} | 134 : ActionableView(owner, ink_drop_style), listener_(listener) {} |
| 139 | 135 |
| 140 bool ButtonListenerActionableView::PerformAction(const ui::Event& event) { | 136 bool ButtonListenerActionableView::PerformAction(const ui::Event& event) { |
| 141 listener_->ButtonPressed(this, event); | 137 listener_->ButtonPressed(this, event); |
| 142 return true; | 138 return true; |
| 143 } | 139 } |
| 144 | 140 |
| 145 } // namespace ash | 141 } // namespace ash |
| OLD | NEW |