| 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/system/tray/actionable_view.h" | 5 #include "ash/system/tray/actionable_view.h" |
| 6 | 6 |
| 7 #include "ash/ash_constants.h" | 7 #include "ash/ash_constants.h" |
| 8 #include "ui/base/accessibility/accessible_view_state.h" | 8 #include "ui/base/accessibility/accessible_view_state.h" |
| 9 #include "ui/gfx/canvas.h" | 9 #include "ui/gfx/canvas.h" |
| 10 | 10 |
| 11 namespace ash { | 11 namespace ash { |
| 12 namespace internal { | 12 namespace internal { |
| 13 | 13 |
| 14 // static | 14 // static |
| 15 const char ActionableView::kViewClassName[] = "tray/ActionableView"; | 15 const char ActionableView::kViewClassName[] = "tray/ActionableView"; |
| 16 | 16 |
| 17 ActionableView::ActionableView() | 17 ActionableView::ActionableView() |
| 18 : has_capture_(false) { | 18 : has_capture_(false) { |
| 19 set_focusable(true); | 19 SetFocusable(true); |
| 20 } | 20 } |
| 21 | 21 |
| 22 ActionableView::~ActionableView() { | 22 ActionableView::~ActionableView() { |
| 23 } | 23 } |
| 24 | 24 |
| 25 void ActionableView::OnPaintFocus(gfx::Canvas* canvas) { | 25 void ActionableView::OnPaintFocus(gfx::Canvas* canvas) { |
| 26 gfx::Rect rect(GetFocusBounds()); | 26 gfx::Rect rect(GetFocusBounds()); |
| 27 rect.Inset(1, 1, 3, 2); | 27 rect.Inset(1, 1, 3, 2); |
| 28 canvas->DrawSolidFocusRect(rect, kFocusBorderColor); | 28 canvas->DrawSolidFocusRect(rect, kFocusBorderColor); |
| 29 } | 29 } |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 SchedulePaint(); | 86 SchedulePaint(); |
| 87 } | 87 } |
| 88 | 88 |
| 89 void ActionableView::OnGestureEvent(ui::GestureEvent* event) { | 89 void ActionableView::OnGestureEvent(ui::GestureEvent* event) { |
| 90 if (event->type() == ui::ET_GESTURE_TAP && PerformAction(*event)) | 90 if (event->type() == ui::ET_GESTURE_TAP && PerformAction(*event)) |
| 91 event->SetHandled(); | 91 event->SetHandled(); |
| 92 } | 92 } |
| 93 | 93 |
| 94 } // namespace internal | 94 } // namespace internal |
| 95 } // namespace ash | 95 } // namespace ash |
| OLD | NEW |