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

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: Review comments. 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..77e704c7d965ead84a6b1a5c51abba7445384272 100644
--- a/chrome/browser/ui/views/download/download_item_view.cc
+++ b/chrome/browser/ui/views/download/download_item_view.cc
@@ -12,6 +12,7 @@
#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/strings/string_util.h"
@@ -350,7 +351,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 +1015,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