OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
(...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
648 state->state = ui::AccessibilityTypes::STATE_HASPOPUP; | 648 state->state = ui::AccessibilityTypes::STATE_HASPOPUP; |
649 } | 649 } |
650 } | 650 } |
651 | 651 |
652 void DownloadItemView::ButtonPressed( | 652 void DownloadItemView::ButtonPressed( |
653 views::Button* sender, const views::Event& event) { | 653 views::Button* sender, const views::Event& event) { |
654 if (sender == discard_button_) { | 654 if (sender == discard_button_) { |
655 UMA_HISTOGRAM_LONG_TIMES("clickjacking.discard_download", | 655 UMA_HISTOGRAM_LONG_TIMES("clickjacking.discard_download", |
656 base::Time::Now() - creation_time_); | 656 base::Time::Now() - creation_time_); |
657 if (download_->IsPartialDownload()) | 657 if (download_->IsPartialDownload()) |
658 download_->Cancel(true); | 658 download_->Cancel(); |
659 download_->Delete(DownloadItem::DELETE_DUE_TO_USER_DISCARD); | 659 download_->Delete(DownloadItem::DELETE_DUE_TO_USER_DISCARD); |
660 // WARNING: we are deleted at this point. Don't access 'this'. | 660 // WARNING: we are deleted at this point. Don't access 'this'. |
661 } else if (sender == save_button_) { | 661 } else if (sender == save_button_) { |
662 // The user has confirmed a dangerous download. We'd record how quickly the | 662 // The user has confirmed a dangerous download. We'd record how quickly the |
663 // user did this to detect whether we're being clickjacked. | 663 // user did this to detect whether we're being clickjacked. |
664 UMA_HISTOGRAM_LONG_TIMES("clickjacking.save_download", | 664 UMA_HISTOGRAM_LONG_TIMES("clickjacking.save_download", |
665 base::Time::Now() - creation_time_); | 665 base::Time::Now() - creation_time_); |
666 // This will change the state and notify us. | 666 // This will change the state and notify us. |
667 download_->DangerousDownloadValidated(); | 667 download_->DangerousDownloadValidated(); |
668 } | 668 } |
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1117 // If the name has changed, notify assistive technology that the name | 1117 // If the name has changed, notify assistive technology that the name |
1118 // has changed so they can announce it immediately. | 1118 // has changed so they can announce it immediately. |
1119 if (new_name != accessible_name_) { | 1119 if (new_name != accessible_name_) { |
1120 accessible_name_ = new_name; | 1120 accessible_name_ = new_name; |
1121 if (GetWidget()) { | 1121 if (GetWidget()) { |
1122 GetWidget()->NotifyAccessibilityEvent( | 1122 GetWidget()->NotifyAccessibilityEvent( |
1123 this, ui::AccessibilityTypes::EVENT_NAME_CHANGED, true); | 1123 this, ui::AccessibilityTypes::EVENT_NAME_CHANGED, true); |
1124 } | 1124 } |
1125 } | 1125 } |
1126 } | 1126 } |
OLD | NEW |