OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/tray_views.h" | 5 #include "ash/system/tray/tray_views.h" |
6 | 6 |
7 #include "ash/ash_constants.h" | 7 #include "ash/ash_constants.h" |
8 #include "ash/system/tray/tray_constants.h" | 8 #include "ash/system/tray/tray_constants.h" |
9 #include "ash/system/tray/tray_item_view.h" | 9 #include "ash/system/tray/tray_item_view.h" |
10 #include "base/i18n/rtl.h" | 10 #include "base/i18n/rtl.h" |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 | 175 |
176 void ActionableView::SetAccessibleName(const string16& name) { | 176 void ActionableView::SetAccessibleName(const string16& name) { |
177 accessible_name_ = name; | 177 accessible_name_ = name; |
178 } | 178 } |
179 | 179 |
180 void ActionableView::OnPaintFocusBorder(gfx::Canvas* canvas) { | 180 void ActionableView::OnPaintFocusBorder(gfx::Canvas* canvas) { |
181 if (HasFocus() && (focusable() || IsAccessibilityFocusable())) | 181 if (HasFocus() && (focusable() || IsAccessibilityFocusable())) |
182 DrawBorder(canvas, GetLocalBounds()); | 182 DrawBorder(canvas, GetLocalBounds()); |
183 } | 183 } |
184 | 184 |
185 ui::EventResult ActionableView::OnGestureEvent(ui::GestureEvent* event) { | 185 void ActionableView::OnGestureEvent(ui::GestureEvent* event) { |
186 if (event->type() == ui::ET_GESTURE_TAP) { | 186 if (event->type() == ui::ET_GESTURE_TAP && PerformAction(*event)) |
187 return PerformAction(*event) ? ui::ER_CONSUMED : | 187 event->SetHandled(); |
188 ui::ER_UNHANDLED; | |
189 } | |
190 return ui::ER_UNHANDLED; | |
191 } | 188 } |
192 | 189 |
193 void ActionableView::GetAccessibleState(ui::AccessibleViewState* state) { | 190 void ActionableView::GetAccessibleState(ui::AccessibleViewState* state) { |
194 state->role = ui::AccessibilityTypes::ROLE_PUSHBUTTON; | 191 state->role = ui::AccessibilityTypes::ROLE_PUSHBUTTON; |
195 state->name = accessible_name_; | 192 state->name = accessible_name_; |
196 } | 193 } |
197 | 194 |
198 //////////////////////////////////////////////////////////////////////////////// | 195 //////////////////////////////////////////////////////////////////////////////// |
199 // HoverHighlightView | 196 // HoverHighlightView |
200 | 197 |
(...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
727 tray_view->set_border(views::Border::CreateEmptyBorder( | 724 tray_view->set_border(views::Border::CreateEmptyBorder( |
728 kTrayLabelItemVerticalPaddingVeriticalAlignment, | 725 kTrayLabelItemVerticalPaddingVeriticalAlignment, |
729 horizontal_padding, | 726 horizontal_padding, |
730 kTrayLabelItemVerticalPaddingVeriticalAlignment, | 727 kTrayLabelItemVerticalPaddingVeriticalAlignment, |
731 horizontal_padding)); | 728 horizontal_padding)); |
732 } | 729 } |
733 } | 730 } |
734 | 731 |
735 } // namespace internal | 732 } // namespace internal |
736 } // namespace ash | 733 } // namespace ash |
OLD | NEW |