OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include "ash/launcher/alternate_app_list_button.h" | 4 #include "ash/launcher/alternate_app_list_button.h" |
5 | 5 |
6 #include "ash/ash_switches.h" | 6 #include "ash/ash_switches.h" |
7 #include "ash/launcher/launcher_button_host.h" | 7 #include "ash/launcher/launcher_button_host.h" |
8 #include "ash/launcher/launcher_types.h" | 8 #include "ash/launcher/launcher_types.h" |
9 #include "ash/shelf/shelf_layout_manager.h" | 9 #include "ash/shelf/shelf_layout_manager.h" |
10 #include "ash/shelf/shelf_widget.h" | 10 #include "ash/shelf/shelf_widget.h" |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 | 139 |
140 OnPaintFocusBorder(canvas); | 140 OnPaintFocusBorder(canvas); |
141 } | 141 } |
142 | 142 |
143 void AlternateAppListButton::GetAccessibleState( | 143 void AlternateAppListButton::GetAccessibleState( |
144 ui::AccessibleViewState* state) { | 144 ui::AccessibleViewState* state) { |
145 state->role = ui::AccessibilityTypes::ROLE_PUSHBUTTON; | 145 state->role = ui::AccessibilityTypes::ROLE_PUSHBUTTON; |
146 state->name = host_->GetAccessibleName(this); | 146 state->name = host_->GetAccessibleName(this); |
147 } | 147 } |
148 | 148 |
149 void AlternateAppListButton::OnGestureEvent(ui::GestureEvent* event) { | |
150 switch (event->type()) { | |
151 case ui::ET_GESTURE_SCROLL_BEGIN: | |
152 host_->PointerPressedOnButton(this, LauncherButtonHost::TOUCH, *event); | |
153 event->SetHandled(); | |
154 return; | |
155 case ui::ET_GESTURE_SCROLL_UPDATE: | |
156 host_->PointerDraggedOnButton(this, LauncherButtonHost::TOUCH, *event); | |
157 event->SetHandled(); | |
158 return; | |
159 case ui::ET_GESTURE_SCROLL_END: | |
160 case ui::ET_SCROLL_FLING_START: | |
161 host_->PointerReleasedOnButton(this, LauncherButtonHost::TOUCH, false); | |
162 event->SetHandled(); | |
163 return; | |
164 default: | |
165 ImageButton::OnGestureEvent(event); | |
166 return; | |
167 } | |
168 } | |
169 | |
170 } // namespace internal | 149 } // namespace internal |
171 } // namespace ash | 150 } // namespace ash |
OLD | NEW |