| 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" |
| 11 #include "ui/accessibility/ax_view_state.h" | 11 #include "ui/accessibility/ax_node_data.h" |
| 12 #include "ui/gfx/canvas.h" | 12 #include "ui/gfx/canvas.h" |
| 13 #include "ui/gfx/geometry/rect_f.h" | 13 #include "ui/gfx/geometry/rect_f.h" |
| 14 #include "ui/views/animation/flood_fill_ink_drop_ripple.h" | 14 #include "ui/views/animation/flood_fill_ink_drop_ripple.h" |
| 15 #include "ui/views/animation/ink_drop_highlight.h" | 15 #include "ui/views/animation/ink_drop_highlight.h" |
| 16 | 16 |
| 17 namespace ash { | 17 namespace ash { |
| 18 | 18 |
| 19 // static | 19 // static |
| 20 const char ActionableView::kViewClassName[] = "tray/ActionableView"; | 20 const char ActionableView::kViewClassName[] = "tray/ActionableView"; |
| 21 | 21 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 50 NotifyClick(event); | 50 NotifyClick(event); |
| 51 return true; | 51 return true; |
| 52 } | 52 } |
| 53 return CustomButton::OnKeyPressed(event); | 53 return CustomButton::OnKeyPressed(event); |
| 54 } | 54 } |
| 55 | 55 |
| 56 void ActionableView::SetAccessibleName(const base::string16& name) { | 56 void ActionableView::SetAccessibleName(const base::string16& name) { |
| 57 accessible_name_ = name; | 57 accessible_name_ = name; |
| 58 } | 58 } |
| 59 | 59 |
| 60 void ActionableView::GetAccessibleState(ui::AXViewState* state) { | 60 void ActionableView::GetAccessibleNodeData(ui::AXNodeData* node_data) { |
| 61 state->role = ui::AX_ROLE_BUTTON; | 61 node_data->role = ui::AX_ROLE_BUTTON; |
| 62 state->name = accessible_name_; | 62 node_data->SetName(accessible_name_); |
| 63 } | 63 } |
| 64 | 64 |
| 65 void ActionableView::OnPaint(gfx::Canvas* canvas) { | 65 void ActionableView::OnPaint(gfx::Canvas* canvas) { |
| 66 CustomButton::OnPaint(canvas); | 66 CustomButton::OnPaint(canvas); |
| 67 if (HasFocus()) | 67 if (HasFocus()) |
| 68 OnPaintFocus(canvas); | 68 OnPaintFocus(canvas); |
| 69 } | 69 } |
| 70 | 70 |
| 71 void ActionableView::OnFocus() { | 71 void ActionableView::OnFocus() { |
| 72 CustomButton::OnFocus(); | 72 CustomButton::OnFocus(); |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 if (action_performed) { | 113 if (action_performed) { |
| 114 AnimateInkDrop(views::InkDropState::ACTION_TRIGGERED, | 114 AnimateInkDrop(views::InkDropState::ACTION_TRIGGERED, |
| 115 ui::LocatedEvent::FromIfValid(&event)); | 115 ui::LocatedEvent::FromIfValid(&event)); |
| 116 } else { | 116 } else { |
| 117 AnimateInkDrop(views::InkDropState::HIDDEN, | 117 AnimateInkDrop(views::InkDropState::HIDDEN, |
| 118 ui::LocatedEvent::FromIfValid(&event)); | 118 ui::LocatedEvent::FromIfValid(&event)); |
| 119 } | 119 } |
| 120 } | 120 } |
| 121 | 121 |
| 122 } // namespace ash | 122 } // namespace ash |
| OLD | NEW |