| 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 "chrome/browser/ui/views/download/download_item_view.h" | 5 #include "chrome/browser/ui/views/download/download_item_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 504 if (event->type() == ui::ET_GESTURE_TAP) { | 504 if (event->type() == ui::ET_GESTURE_TAP) { |
| 505 HandleClickEvent(*event, true); | 505 HandleClickEvent(*event, true); |
| 506 event->SetHandled(); | 506 event->SetHandled(); |
| 507 return; | 507 return; |
| 508 } | 508 } |
| 509 | 509 |
| 510 SetState(NORMAL, NORMAL); | 510 SetState(NORMAL, NORMAL); |
| 511 views::View::OnGestureEvent(event); | 511 views::View::OnGestureEvent(event); |
| 512 } | 512 } |
| 513 | 513 |
| 514 void DownloadItemView::ShowContextMenuForView(View* source, | 514 void DownloadItemView::ShowContextMenuForView( |
| 515 const gfx::Point& point) { | 515 View* source, |
| 516 const gfx::Point& point, |
| 517 ui::ContextMenuSourceType source_type) { |
| 516 // |point| is in screen coordinates. So convert it to local coordinates first. | 518 // |point| is in screen coordinates. So convert it to local coordinates first. |
| 517 gfx::Point local_point = point; | 519 gfx::Point local_point = point; |
| 518 ConvertPointFromScreen(this, &local_point); | 520 ConvertPointFromScreen(this, &local_point); |
| 519 ShowContextMenuImpl(local_point, true); | 521 ShowContextMenuImpl(local_point, true); |
| 520 } | 522 } |
| 521 | 523 |
| 522 void DownloadItemView::ButtonPressed( | 524 void DownloadItemView::ButtonPressed( |
| 523 views::Button* sender, const ui::Event& event) { | 525 views::Button* sender, const ui::Event& event) { |
| 524 if (sender == discard_button_) { | 526 if (sender == discard_button_) { |
| 525 UMA_HISTOGRAM_LONG_TIMES("clickjacking.discard_download", | 527 UMA_HISTOGRAM_LONG_TIMES("clickjacking.discard_download", |
| (...skipping 684 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1210 void DownloadItemView::AnimateStateTransition(State from, State to, | 1212 void DownloadItemView::AnimateStateTransition(State from, State to, |
| 1211 ui::SlideAnimation* animation) { | 1213 ui::SlideAnimation* animation) { |
| 1212 if (from == NORMAL && to == HOT) { | 1214 if (from == NORMAL && to == HOT) { |
| 1213 animation->Show(); | 1215 animation->Show(); |
| 1214 } else if (from == HOT && to == NORMAL) { | 1216 } else if (from == HOT && to == NORMAL) { |
| 1215 animation->Hide(); | 1217 animation->Hide(); |
| 1216 } else if (from != to) { | 1218 } else if (from != to) { |
| 1217 animation->Reset((to == HOT) ? 1.0 : 0.0); | 1219 animation->Reset((to == HOT) ? 1.0 : 0.0); |
| 1218 } | 1220 } |
| 1219 } | 1221 } |
| OLD | NEW |