| 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/launcher/launcher_button.h" | 5 #include "ash/launcher/launcher_button.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "ash/launcher/launcher_button_host.h" | 9 #include "ash/launcher/launcher_button_host.h" |
| 10 #include "grit/ui_resources.h" | 10 #include "grit/ui_resources.h" |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 CustomButton::OnMouseEntered(event); | 251 CustomButton::OnMouseEntered(event); |
| 252 host_->MouseEnteredButton(this); | 252 host_->MouseEnteredButton(this); |
| 253 } | 253 } |
| 254 | 254 |
| 255 void LauncherButton::OnMouseExited(const ui::MouseEvent& event) { | 255 void LauncherButton::OnMouseExited(const ui::MouseEvent& event) { |
| 256 ClearState(STATE_HOVERED); | 256 ClearState(STATE_HOVERED); |
| 257 CustomButton::OnMouseExited(event); | 257 CustomButton::OnMouseExited(event); |
| 258 host_->MouseExitedButton(this); | 258 host_->MouseExitedButton(this); |
| 259 } | 259 } |
| 260 | 260 |
| 261 ui::GestureStatus LauncherButton::OnGestureEvent( | 261 ui::EventResult LauncherButton::OnGestureEvent( |
| 262 const ui::GestureEvent& event) { | 262 const ui::GestureEvent& event) { |
| 263 switch (event.type()) { | 263 switch (event.type()) { |
| 264 case ui::ET_GESTURE_TAP_DOWN: | 264 case ui::ET_GESTURE_TAP_DOWN: |
| 265 AddState(STATE_HOVERED); | 265 AddState(STATE_HOVERED); |
| 266 return CustomButton::OnGestureEvent(event); | 266 return CustomButton::OnGestureEvent(event); |
| 267 case ui::ET_GESTURE_END: | 267 case ui::ET_GESTURE_END: |
| 268 ClearState(STATE_HOVERED); | 268 ClearState(STATE_HOVERED); |
| 269 return CustomButton::OnGestureEvent(event); | 269 return CustomButton::OnGestureEvent(event); |
| 270 case ui::ET_GESTURE_SCROLL_BEGIN: | 270 case ui::ET_GESTURE_SCROLL_BEGIN: |
| 271 host_->PointerPressedOnButton(this, LauncherButtonHost::TOUCH, event); | 271 host_->PointerPressedOnButton(this, LauncherButtonHost::TOUCH, event); |
| 272 return ui::GESTURE_STATUS_CONSUMED; | 272 return ui::ER_CONSUMED; |
| 273 case ui::ET_GESTURE_SCROLL_UPDATE: | 273 case ui::ET_GESTURE_SCROLL_UPDATE: |
| 274 host_->PointerDraggedOnButton(this, LauncherButtonHost::TOUCH, event); | 274 host_->PointerDraggedOnButton(this, LauncherButtonHost::TOUCH, event); |
| 275 return ui::GESTURE_STATUS_CONSUMED; | 275 return ui::ER_CONSUMED; |
| 276 case ui::ET_GESTURE_SCROLL_END: | 276 case ui::ET_GESTURE_SCROLL_END: |
| 277 host_->PointerReleasedOnButton(this, LauncherButtonHost::TOUCH, false); | 277 host_->PointerReleasedOnButton(this, LauncherButtonHost::TOUCH, false); |
| 278 return ui::GESTURE_STATUS_CONSUMED; | 278 return ui::ER_CONSUMED; |
| 279 default: | 279 default: |
| 280 return CustomButton::OnGestureEvent(event); | 280 return CustomButton::OnGestureEvent(event); |
| 281 } | 281 } |
| 282 } | 282 } |
| 283 | 283 |
| 284 void LauncherButton::GetAccessibleState(ui::AccessibleViewState* state) { | 284 void LauncherButton::GetAccessibleState(ui::AccessibleViewState* state) { |
| 285 state->role = ui::AccessibilityTypes::ROLE_PUSHBUTTON; | 285 state->role = ui::AccessibilityTypes::ROLE_PUSHBUTTON; |
| 286 state->name = host_->GetAccessibleName(this); | 286 state->name = host_->GetAccessibleName(this); |
| 287 } | 287 } |
| 288 | 288 |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 399 bar_->SetVerticalAlignment(views::ImageView::CENTER); | 399 bar_->SetVerticalAlignment(views::ImageView::CENTER); |
| 400 break; | 400 break; |
| 401 } | 401 } |
| 402 | 402 |
| 403 Layout(); | 403 Layout(); |
| 404 SchedulePaint(); | 404 SchedulePaint(); |
| 405 } | 405 } |
| 406 | 406 |
| 407 } // namespace internal | 407 } // namespace internal |
| 408 } // namespace ash | 408 } // namespace ash |
| OLD | NEW |