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

Side by Side Diff: chrome/browser/ui/gtk/download/download_item_gtk.cc

Issue 14307023: chrome: Use base::MessageLoop. (Part 2) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 7 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) 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/gtk/download/download_item_gtk.h" 5 #include "chrome/browser/ui/gtk/download/download_item_gtk.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/debug/trace_event.h" 9 #include "base/debug/trace_event.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 802 matching lines...) Expand 10 before | Expand all | Expand 10 after
813 813
814 void DownloadItemGtk::ReenableHbox() { 814 void DownloadItemGtk::ReenableHbox() {
815 gtk_widget_set_sensitive(hbox_.get(), true); 815 gtk_widget_set_sensitive(hbox_.get(), true);
816 disabled_while_opening_ = false; 816 disabled_while_opening_ = false;
817 UpdateNameLabel(); 817 UpdateNameLabel();
818 } 818 }
819 819
820 void DownloadItemGtk::OnDownloadOpened(DownloadItem* download) { 820 void DownloadItemGtk::OnDownloadOpened(DownloadItem* download) {
821 disabled_while_opening_ = true; 821 disabled_while_opening_ = true;
822 gtk_widget_set_sensitive(hbox_.get(), false); 822 gtk_widget_set_sensitive(hbox_.get(), false);
823 MessageLoop::current()->PostDelayedTask( 823 base::MessageLoop::current()->PostDelayedTask(
824 FROM_HERE, 824 FROM_HERE,
825 base::Bind(&DownloadItemGtk::ReenableHbox, 825 base::Bind(&DownloadItemGtk::ReenableHbox,
826 weak_ptr_factory_.GetWeakPtr()), 826 weak_ptr_factory_.GetWeakPtr()),
827 base::TimeDelta::FromMilliseconds(kDisabledOnOpenDurationMs)); 827 base::TimeDelta::FromMilliseconds(kDisabledOnOpenDurationMs));
828 UpdateNameLabel(); 828 UpdateNameLabel();
829 parent_shelf_->ItemOpened(); 829 parent_shelf_->ItemOpened();
830 } 830 }
831 831
832 void DownloadItemGtk::OnClick(GtkWidget* widget) { 832 void DownloadItemGtk::OnClick(GtkWidget* widget) {
833 UMA_HISTOGRAM_LONG_TIMES("clickjacking.open_download", 833 UMA_HISTOGRAM_LONG_TIMES("clickjacking.open_download",
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
925 download()->DangerousDownloadValidated(); 925 download()->DangerousDownloadValidated();
926 } 926 }
927 927
928 void DownloadItemGtk::OnDangerousDecline(GtkWidget* button) { 928 void DownloadItemGtk::OnDangerousDecline(GtkWidget* button) {
929 UMA_HISTOGRAM_LONG_TIMES("clickjacking.discard_download", 929 UMA_HISTOGRAM_LONG_TIMES("clickjacking.discard_download",
930 base::Time::Now() - creation_time_); 930 base::Time::Now() - creation_time_);
931 if (download()->IsPartialDownload()) 931 if (download()->IsPartialDownload())
932 download()->Cancel(true); 932 download()->Cancel(true);
933 download()->Delete(DownloadItem::DELETE_DUE_TO_USER_DISCARD); 933 download()->Delete(DownloadItem::DELETE_DUE_TO_USER_DISCARD);
934 } 934 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/gtk/chrome_to_mobile_bubble_gtk.cc ('k') | chrome/browser/ui/gtk/download/download_shelf_gtk.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698