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..37d27156f730ea9b926a327d278bf701fc85b371 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" |
#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::ThreadTaskRunnerHandle::Get()->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::ThreadTaskRunnerHandle::Get()->PostNonNestableTask( |
+ FROM_HERE, base::Bind(&DownloadItemView::ReleaseDropDown, |
+ weak_ptr_factory_.GetWeakPtr())); |
views::View::ConvertPointToScreen(this, &point); |
if (!context_menu_.get()) |