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

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

Issue 7294013: Modified cancel and interrupt processing to avoid race with history. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merged to TOT. Again :-}. Created 9 years, 5 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 636 matching lines...) Expand 10 before | Expand all | Expand 10 after
647 state->state = ui::AccessibilityTypes::STATE_HASPOPUP; 647 state->state = ui::AccessibilityTypes::STATE_HASPOPUP;
648 } 648 }
649 } 649 }
650 650
651 void DownloadItemView::ButtonPressed( 651 void DownloadItemView::ButtonPressed(
652 views::Button* sender, const views::Event& event) { 652 views::Button* sender, const views::Event& event) {
653 if (sender == discard_button_) { 653 if (sender == discard_button_) {
654 UMA_HISTOGRAM_LONG_TIMES("clickjacking.discard_download", 654 UMA_HISTOGRAM_LONG_TIMES("clickjacking.discard_download",
655 base::Time::Now() - creation_time_); 655 base::Time::Now() - creation_time_);
656 if (download_->IsPartialDownload()) 656 if (download_->IsPartialDownload())
657 download_->Cancel(true); 657 download_->Cancel();
658 download_->Delete(DownloadItem::DELETE_DUE_TO_USER_DISCARD); 658 download_->Delete(DownloadItem::DELETE_DUE_TO_USER_DISCARD);
659 // WARNING: we are deleted at this point. Don't access 'this'. 659 // WARNING: we are deleted at this point. Don't access 'this'.
660 } else if (sender == save_button_) { 660 } else if (sender == save_button_) {
661 // The user has confirmed a dangerous download. We'd record how quickly the 661 // The user has confirmed a dangerous download. We'd record how quickly the
662 // user did this to detect whether we're being clickjacked. 662 // user did this to detect whether we're being clickjacked.
663 UMA_HISTOGRAM_LONG_TIMES("clickjacking.save_download", 663 UMA_HISTOGRAM_LONG_TIMES("clickjacking.save_download",
664 base::Time::Now() - creation_time_); 664 base::Time::Now() - creation_time_);
665 // This will change the state and notify us. 665 // This will change the state and notify us.
666 download_->DangerousDownloadValidated(); 666 download_->DangerousDownloadValidated();
667 } 667 }
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after
1116 // If the name has changed, notify assistive technology that the name 1116 // If the name has changed, notify assistive technology that the name
1117 // has changed so they can announce it immediately. 1117 // has changed so they can announce it immediately.
1118 if (new_name != accessible_name_) { 1118 if (new_name != accessible_name_) {
1119 accessible_name_ = new_name; 1119 accessible_name_ = new_name;
1120 if (GetWidget()) { 1120 if (GetWidget()) {
1121 GetWidget()->NotifyAccessibilityEvent( 1121 GetWidget()->NotifyAccessibilityEvent(
1122 this, ui::AccessibilityTypes::EVENT_NAME_CHANGED, true); 1122 this, ui::AccessibilityTypes::EVENT_NAME_CHANGED, true);
1123 } 1123 }
1124 } 1124 }
1125 } 1125 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/gtk/download/download_item_gtk.cc ('k') | chrome/browser/ui/webui/active_downloads_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698