| 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 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 489 return true; | 489 return true; |
| 490 | 490 |
| 491 if (event.key_code() == ui::VKEY_SPACE || | 491 if (event.key_code() == ui::VKEY_SPACE || |
| 492 event.key_code() == ui::VKEY_RETURN) { | 492 event.key_code() == ui::VKEY_RETURN) { |
| 493 OpenDownload(); | 493 OpenDownload(); |
| 494 return true; | 494 return true; |
| 495 } | 495 } |
| 496 return false; | 496 return false; |
| 497 } | 497 } |
| 498 | 498 |
| 499 ui::GestureStatus DownloadItemView::OnGestureEvent( | 499 ui::EventResult DownloadItemView::OnGestureEvent( |
| 500 const ui::GestureEvent& event) { | 500 const ui::GestureEvent& event) { |
| 501 if (event.type() == ui::ET_GESTURE_TAP_DOWN) { | 501 if (event.type() == ui::ET_GESTURE_TAP_DOWN) { |
| 502 HandlePressEvent(event, true); | 502 HandlePressEvent(event, true); |
| 503 return ui::GESTURE_STATUS_CONSUMED; | 503 return ui::ER_CONSUMED; |
| 504 } | 504 } |
| 505 | 505 |
| 506 if (event.type() == ui::ET_GESTURE_TAP) { | 506 if (event.type() == ui::ET_GESTURE_TAP) { |
| 507 HandleClickEvent(event, true); | 507 HandleClickEvent(event, true); |
| 508 return ui::GESTURE_STATUS_CONSUMED; | 508 return ui::ER_CONSUMED; |
| 509 } | 509 } |
| 510 | 510 |
| 511 SetState(NORMAL, NORMAL); | 511 SetState(NORMAL, NORMAL); |
| 512 return views::View::OnGestureEvent(event); | 512 return views::View::OnGestureEvent(event); |
| 513 } | 513 } |
| 514 | 514 |
| 515 bool DownloadItemView::GetTooltipText(const gfx::Point& p, | 515 bool DownloadItemView::GetTooltipText(const gfx::Point& p, |
| 516 string16* tooltip) const { | 516 string16* tooltip) const { |
| 517 if (IsShowingWarningDialog()) { | 517 if (IsShowingWarningDialog()) { |
| 518 tooltip->clear(); | 518 tooltip->clear(); |
| (...skipping 698 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1217 // Drop down button is glued to the left of the download shelf. | 1217 // Drop down button is glued to the left of the download shelf. |
| 1218 drop_down_x_left_ = 0; | 1218 drop_down_x_left_ = 0; |
| 1219 drop_down_x_right_ = normal_drop_down_image_set_.top->width(); | 1219 drop_down_x_right_ = normal_drop_down_image_set_.top->width(); |
| 1220 } else { | 1220 } else { |
| 1221 // Drop down button is glued to the right of the download shelf. | 1221 // Drop down button is glued to the right of the download shelf. |
| 1222 drop_down_x_left_ = | 1222 drop_down_x_left_ = |
| 1223 size.width() - normal_drop_down_image_set_.top->width(); | 1223 size.width() - normal_drop_down_image_set_.top->width(); |
| 1224 drop_down_x_right_ = size.width(); | 1224 drop_down_x_right_ = size.width(); |
| 1225 } | 1225 } |
| 1226 } | 1226 } |
| OLD | NEW |