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 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "ash/launcher/launcher_button_host.h" | 10 #include "ash/launcher/launcher_button_host.h" |
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 host_->MouseEnteredButton(this); | 359 host_->MouseEnteredButton(this); |
360 } | 360 } |
361 | 361 |
362 void LauncherButton::OnMouseExited(const ui::MouseEvent& event) { | 362 void LauncherButton::OnMouseExited(const ui::MouseEvent& event) { |
363 ClearState(STATE_HOVERED); | 363 ClearState(STATE_HOVERED); |
364 CustomButton::OnMouseExited(event); | 364 CustomButton::OnMouseExited(event); |
365 host_->MouseExitedButton(this); | 365 host_->MouseExitedButton(this); |
366 } | 366 } |
367 | 367 |
368 ui::GestureStatus LauncherButton::OnGestureEvent( | 368 ui::GestureStatus LauncherButton::OnGestureEvent( |
369 const views::GestureEvent& event) { | 369 const ui::GestureEvent& event) { |
370 switch (event.type()) { | 370 switch (event.type()) { |
371 case ui::ET_GESTURE_TAP_DOWN: | 371 case ui::ET_GESTURE_TAP_DOWN: |
372 AddState(STATE_HOVERED); | 372 AddState(STATE_HOVERED); |
373 return CustomButton::OnGestureEvent(event); | 373 return CustomButton::OnGestureEvent(event); |
374 case ui::ET_GESTURE_END: | 374 case ui::ET_GESTURE_END: |
375 ClearState(STATE_HOVERED); | 375 ClearState(STATE_HOVERED); |
376 return CustomButton::OnGestureEvent(event); | 376 return CustomButton::OnGestureEvent(event); |
377 case ui::ET_GESTURE_SCROLL_BEGIN: | 377 case ui::ET_GESTURE_SCROLL_BEGIN: |
378 host_->PointerPressedOnButton(this, LauncherButtonHost::TOUCH, event); | 378 host_->PointerPressedOnButton(this, LauncherButtonHost::TOUCH, event); |
379 return ui::GESTURE_STATUS_CONSUMED; | 379 return ui::GESTURE_STATUS_CONSUMED; |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
502 bar_->SetVerticalAlignment(views::ImageView::CENTER); | 502 bar_->SetVerticalAlignment(views::ImageView::CENTER); |
503 break; | 503 break; |
504 } | 504 } |
505 | 505 |
506 Layout(); | 506 Layout(); |
507 SchedulePaint(); | 507 SchedulePaint(); |
508 } | 508 } |
509 | 509 |
510 } // namespace internal | 510 } // namespace internal |
511 } // namespace ash | 511 } // namespace ash |
OLD | NEW |