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

Unified Diff: chrome/browser/ui/views/download/download_item_view.cc

Issue 1160073004: chrome/browser/ui: Remove use of MessageLoopProxy and deprecated MessageLoop APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Harmonize MessageLoop/TTRH usage. Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/download/download_item_view.cc
diff --git a/chrome/browser/ui/views/download/download_item_view.cc b/chrome/browser/ui/views/download/download_item_view.cc
index 63cac8819610e82b2911b3c9ffc94d0438ce9902..742b2286ce501224894b88c5d6ff78061e321853 100644
--- a/chrome/browser/ui/views/download/download_item_view.cc
+++ b/chrome/browser/ui/views/download/download_item_view.cc
@@ -12,12 +12,15 @@
#include "base/files/file_path.h"
#include "base/i18n/break_iterator.h"
#include "base/i18n/rtl.h"
+#include "base/location.h"
#include "base/metrics/histogram.h"
#include "base/prefs/pref_service.h"
+#include "base/single_thread_task_runner.h"
msw 2015/06/12 00:31:21 nit: remove sttr and ttrh headers.
Sami 2015/06/12 10:56:22 Done.
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "base/strings/sys_string_conversions.h"
#include "base/strings/utf_string_conversions.h"
+#include "base/thread_task_runner_handle.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/download/chrome_download_manager_delegate.h"
#include "chrome/browser/download/download_item_model.h"
@@ -350,7 +353,7 @@ void DownloadItemView::OnDownloadDestroyed(DownloadItem* download) {
void DownloadItemView::OnDownloadOpened(DownloadItem* download) {
disabled_while_opening_ = true;
SetEnabled(false);
- base::MessageLoop::current()->PostDelayedTask(
+ base::MessageLoop::current()->task_runner()->PostDelayedTask(
FROM_HERE,
base::Bind(&DownloadItemView::Reenable, weak_ptr_factory_.GetWeakPtr()),
base::TimeDelta::FromMilliseconds(kDisabledOnOpenDuration));
@@ -1014,10 +1017,9 @@ void DownloadItemView::ShowContextMenuImpl(const gfx::Point& p,
// Post a task to release the button. When we call the Run method on the menu
// below, it runs an inner message loop that might cause us to be deleted.
// Posting a task with a WeakPtr lets us safely handle the button release.
- base::MessageLoop::current()->PostNonNestableTask(
- FROM_HERE,
- base::Bind(&DownloadItemView::ReleaseDropDown,
- weak_ptr_factory_.GetWeakPtr()));
+ base::MessageLoop::current()->task_runner()->PostNonNestableTask(
+ FROM_HERE, base::Bind(&DownloadItemView::ReleaseDropDown,
+ weak_ptr_factory_.GetWeakPtr()));
views::View::ConvertPointToScreen(this, &point);
if (!context_menu_.get())

Powered by Google App Engine
This is Rietveld 408576698