| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/notification/download_group_notification.h" | 5 #include "chrome/browser/download/notification/download_group_notification.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 Profile* profile, DownloadNotificationManagerForProfile* manager) | 96 Profile* profile, DownloadNotificationManagerForProfile* manager) |
| 97 : profile_(profile) { | 97 : profile_(profile) { |
| 98 | 98 |
| 99 ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance(); | 99 ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance(); |
| 100 | 100 |
| 101 message_center::RichNotificationData data; | 101 message_center::RichNotificationData data; |
| 102 // Creates the notification instance. |title| and |body| will be overridden | 102 // Creates the notification instance. |title| and |body| will be overridden |
| 103 // by UpdateNotificationData() below. | 103 // by UpdateNotificationData() below. |
| 104 notification_.reset(new Notification( | 104 notification_.reset(new Notification( |
| 105 message_center::NOTIFICATION_TYPE_MULTIPLE, | 105 message_center::NOTIFICATION_TYPE_MULTIPLE, |
| 106 GURL(kDownloadNotificationOrigin), // origin_url | 106 base::string16(), // title |
| 107 base::string16(), // title | 107 base::string16(), // body |
| 108 base::string16(), // body | |
| 109 bundle.GetImageNamed(IDR_DOWNLOAD_NOTIFICATION_DOWNLOADING), | 108 bundle.GetImageNamed(IDR_DOWNLOAD_NOTIFICATION_DOWNLOADING), |
| 110 message_center::NotifierId(message_center::NotifierId::SYSTEM_COMPONENT, | 109 message_center::NotifierId(message_center::NotifierId::SYSTEM_COMPONENT, |
| 111 kDownloadNotificationNotifierId), | 110 kDownloadNotificationNotifierId), |
| 112 base::string16(), // display_source | 111 base::string16(), // display_source |
| 113 "GROUP", // tag | 112 GURL(kDownloadNotificationOrigin), // origin_url |
| 113 "GROUP", // tag |
| 114 data, watcher())); | 114 data, watcher())); |
| 115 | 115 |
| 116 notification_->SetSystemPriority(); | 116 notification_->SetSystemPriority(); |
| 117 notification_->set_never_timeout(false); | 117 notification_->set_never_timeout(false); |
| 118 | 118 |
| 119 std::vector<message_center::ButtonInfo> notification_actions; | 119 std::vector<message_center::ButtonInfo> notification_actions; |
| 120 message_center::ButtonInfo button_info = | 120 message_center::ButtonInfo button_info = |
| 121 message_center::ButtonInfo(l10n_util::GetStringUTF16( | 121 message_center::ButtonInfo(l10n_util::GetStringUTF16( |
| 122 IDS_DOWNLOAD_LINK_SHOW_ALL_DOWNLOADS)); | 122 IDS_DOWNLOAD_LINK_SHOW_ALL_DOWNLOADS)); |
| 123 notification_actions.push_back(button_info); | 123 notification_actions.push_back(button_info); |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 chrome::ScopedTabbedBrowserDisplayer browser_displayer( | 273 chrome::ScopedTabbedBrowserDisplayer browser_displayer( |
| 274 profile_, chrome::GetActiveDesktop()); | 274 profile_, chrome::GetActiveDesktop()); |
| 275 Browser* browser = browser_displayer.browser(); | 275 Browser* browser = browser_displayer.browser(); |
| 276 DCHECK(browser); | 276 DCHECK(browser); |
| 277 | 277 |
| 278 browser->OpenURL(content::OpenURLParams( | 278 browser->OpenURL(content::OpenURLParams( |
| 279 GURL(chrome::kChromeUIDownloadsURL), content::Referrer(), | 279 GURL(chrome::kChromeUIDownloadsURL), content::Referrer(), |
| 280 NEW_FOREGROUND_TAB, ui::PAGE_TRANSITION_LINK, | 280 NEW_FOREGROUND_TAB, ui::PAGE_TRANSITION_LINK, |
| 281 false /* is_renderer_initiated */)); | 281 false /* is_renderer_initiated */)); |
| 282 } | 282 } |
| OLD | NEW |