Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(50)

Side by Side Diff: chrome/browser/ui/views/download/download_item_view.cc

Issue 7796014: Make cancel remove cancelled download from active queues at time of cancel. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Final Cancel arg fix. Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698