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 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
536 | 536 |
537 void DownloadItemView::ShowContextMenuForView(View* source, | 537 void DownloadItemView::ShowContextMenuForView(View* source, |
538 const gfx::Point& point) { | 538 const gfx::Point& point) { |
539 // |point| is in screen coordinates. So convert it to local coordinates first. | 539 // |point| is in screen coordinates. So convert it to local coordinates first. |
540 gfx::Point local_point = point; | 540 gfx::Point local_point = point; |
541 ConvertPointFromScreen(this, &local_point); | 541 ConvertPointFromScreen(this, &local_point); |
542 ShowContextMenuImpl(local_point, true); | 542 ShowContextMenuImpl(local_point, true); |
543 } | 543 } |
544 | 544 |
545 void DownloadItemView::ButtonPressed( | 545 void DownloadItemView::ButtonPressed( |
546 views::Button* sender, const views::Event& event) { | 546 views::Button* sender, const ui::Event& event) { |
547 if (sender == discard_button_) { | 547 if (sender == discard_button_) { |
548 UMA_HISTOGRAM_LONG_TIMES("clickjacking.discard_download", | 548 UMA_HISTOGRAM_LONG_TIMES("clickjacking.discard_download", |
549 base::Time::Now() - creation_time_); | 549 base::Time::Now() - creation_time_); |
550 if (download_->IsPartialDownload()) | 550 if (download_->IsPartialDownload()) |
551 download_->Cancel(true); | 551 download_->Cancel(true); |
552 download_->Delete(DownloadItem::DELETE_DUE_TO_USER_DISCARD); | 552 download_->Delete(DownloadItem::DELETE_DUE_TO_USER_DISCARD); |
553 // WARNING: we are deleted at this point. Don't access 'this'. | 553 // WARNING: we are deleted at this point. Don't access 'this'. |
554 } else if (save_button_ && sender == save_button_) { | 554 } else if (save_button_ && sender == save_button_) { |
555 // The user has confirmed a dangerous download. We'd record how quickly the | 555 // The user has confirmed a dangerous download. We'd record how quickly the |
556 // user did this to detect whether we're being clickjacked. | 556 // user did this to detect whether we're being clickjacked. |
(...skipping 660 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 |