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

Unified Diff: chrome/browser/download/download_status_updater_win.cc

Issue 11096013: Add functionality to the Windows 8 notification display functionality to invoke a caller specified … (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 2 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/download/download_status_updater_win.cc
===================================================================
--- chrome/browser/download/download_status_updater_win.cc (revision 160674)
+++ chrome/browser/download/download_status_updater_win.cc (working copy)
@@ -7,15 +7,18 @@
#include <string>
#include <shobjidl.h>
+#include "base/file_path.h"
#include "base/logging.h"
#include "base/stl_util.h"
#include "base/string_number_conversions.h"
#include "base/win/metro.h"
#include "base/win/scoped_comptr.h"
#include "base/win/windows_version.h"
+#include "chrome/browser/platform_util.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_list.h"
#include "chrome/browser/ui/browser_window.h"
+#include "content/public/browser/browser_thread.h"
#include "googleurl/src/gurl.h"
#include "grit/generated_resources.h"
#include "ui/base/l10n/l10n_util.h"
@@ -67,6 +70,17 @@
}
}
+void MetroDownloadNotificationClickedHandler(const wchar_t* download_path) {
+ // Metro chrome will invoke these handlers on the metro thread.
+ DCHECK(!content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
+
+ // Ensure that we invoke the function to display the downloaded item on the
+ // UI thread.
+ content::BrowserThread::PostTask(
+ content::BrowserThread::UI, FROM_HERE,
+ base::Bind(platform_util::ShowItemInFolder, FilePath(download_path)));
+}
+
} // namespace
void DownloadStatusUpdater::UpdateAppIconDownloadProgress(
@@ -116,7 +130,9 @@
title.c_str(),
body.c_str(),
L"",
- notification_id.c_str());
+ notification_id.c_str(),
+ MetroDownloadNotificationClickedHandler,
+ download->GetFullPath().value().c_str());
}
}

Powered by Google App Engine
This is Rietveld 408576698