| OLD | NEW |
| 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/download/download_status_updater.h" | 5 #include "chrome/browser/download/download_status_updater.h" |
| 6 | 6 |
| 7 #include <shobjidl.h> | 7 #include <shobjidl.h> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 } | 119 } |
| 120 | 120 |
| 121 // In Windows 8 metro mode display a metro style notification which | 121 // In Windows 8 metro mode display a metro style notification which |
| 122 // informs the user that the download is complete. | 122 // informs the user that the download is complete. |
| 123 HMODULE metro = base::win::GetMetroModule(); | 123 HMODULE metro = base::win::GetMetroModule(); |
| 124 base::win::MetroNotification display_notification = | 124 base::win::MetroNotification display_notification = |
| 125 reinterpret_cast<base::win::MetroNotification>( | 125 reinterpret_cast<base::win::MetroNotification>( |
| 126 ::GetProcAddress(metro, "DisplayNotification")); | 126 ::GetProcAddress(metro, "DisplayNotification")); |
| 127 DCHECK(display_notification); | 127 DCHECK(display_notification); |
| 128 if (display_notification) { | 128 if (display_notification) { |
| 129 string16 title = l10n_util::GetStringUTF16( | 129 base::string16 title = l10n_util::GetStringUTF16( |
| 130 IDS_METRO_DOWNLOAD_COMPLETE_NOTIFICATION_TITLE); | 130 IDS_METRO_DOWNLOAD_COMPLETE_NOTIFICATION_TITLE); |
| 131 string16 body = l10n_util::GetStringUTF16( | 131 base::string16 body = l10n_util::GetStringUTF16( |
| 132 IDS_METRO_DOWNLOAD_COMPLETE_NOTIFICATION); | 132 IDS_METRO_DOWNLOAD_COMPLETE_NOTIFICATION); |
| 133 | 133 |
| 134 // Dummy notification id. Every metro style notification needs a | 134 // Dummy notification id. Every metro style notification needs a |
| 135 // unique notification id. | 135 // unique notification id. |
| 136 std::string notification_id = kDownloadNotificationPrefix; | 136 std::string notification_id = kDownloadNotificationPrefix; |
| 137 notification_id += base::IntToString(g_next_notification_id++); | 137 notification_id += base::IntToString(g_next_notification_id++); |
| 138 | 138 |
| 139 display_notification(download->GetURL().spec().c_str(), | 139 display_notification(download->GetURL().spec().c_str(), |
| 140 "", | 140 "", |
| 141 title.c_str(), | 141 title.c_str(), |
| 142 body.c_str(), | 142 body.c_str(), |
| 143 L"", | 143 L"", |
| 144 notification_id.c_str(), | 144 notification_id.c_str(), |
| 145 MetroDownloadNotificationClickedHandler, | 145 MetroDownloadNotificationClickedHandler, |
| 146 download->GetTargetFilePath().value().c_str()); | 146 download->GetTargetFilePath().value().c_str()); |
| 147 } | 147 } |
| 148 } | 148 } |
| OLD | NEW |