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 30 matching lines...) Expand all Loading... |
41 Profile* profile, DownloadNotificationManagerForProfile* manager) | 41 Profile* profile, DownloadNotificationManagerForProfile* manager) |
42 : profile_(profile) { | 42 : profile_(profile) { |
43 | 43 |
44 ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance(); | 44 ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance(); |
45 | 45 |
46 message_center::RichNotificationData data; | 46 message_center::RichNotificationData data; |
47 // Creates the notification instance. |title| and |body| will be overridden | 47 // Creates the notification instance. |title| and |body| will be overridden |
48 // by UpdateNotificationData() below. | 48 // by UpdateNotificationData() below. |
49 notification_.reset(new Notification( | 49 notification_.reset(new Notification( |
50 message_center::NOTIFICATION_TYPE_MULTIPLE, | 50 message_center::NOTIFICATION_TYPE_MULTIPLE, |
51 GURL(kDownloadNotificationOrigin), // origin_url | 51 base::string16(), // title |
52 base::string16(), // title | 52 base::string16(), // body |
53 base::string16(), // body | |
54 bundle.GetImageNamed(IDR_DOWNLOAD_NOTIFICATION_DOWNLOADING), | 53 bundle.GetImageNamed(IDR_DOWNLOAD_NOTIFICATION_DOWNLOADING), |
55 message_center::NotifierId(message_center::NotifierId::SYSTEM_COMPONENT, | 54 message_center::NotifierId(message_center::NotifierId::SYSTEM_COMPONENT, |
56 kDownloadNotificationNotifierId), | 55 kDownloadNotificationNotifierId), |
57 base::string16(), // display_source | 56 base::string16(), // display_source |
58 "GROUP", // tag | 57 GURL(kDownloadNotificationOrigin), // origin_url |
| 58 "GROUP", // tag |
59 data, watcher())); | 59 data, watcher())); |
60 | 60 |
61 notification_->SetSystemPriority(); | 61 notification_->SetSystemPriority(); |
62 notification_->set_never_timeout(false); | 62 notification_->set_never_timeout(false); |
63 | 63 |
64 std::vector<message_center::ButtonInfo> notification_actions; | 64 std::vector<message_center::ButtonInfo> notification_actions; |
65 message_center::ButtonInfo button_info = | 65 message_center::ButtonInfo button_info = |
66 message_center::ButtonInfo(l10n_util::GetStringUTF16( | 66 message_center::ButtonInfo(l10n_util::GetStringUTF16( |
67 IDS_DOWNLOAD_LINK_SHOW_ALL_DOWNLOADS)); | 67 IDS_DOWNLOAD_LINK_SHOW_ALL_DOWNLOADS)); |
68 notification_actions.push_back(button_info); | 68 notification_actions.push_back(button_info); |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 chrome::ScopedTabbedBrowserDisplayer browser_displayer( | 207 chrome::ScopedTabbedBrowserDisplayer browser_displayer( |
208 profile_, chrome::GetActiveDesktop()); | 208 profile_, chrome::GetActiveDesktop()); |
209 Browser* browser = browser_displayer.browser(); | 209 Browser* browser = browser_displayer.browser(); |
210 DCHECK(browser); | 210 DCHECK(browser); |
211 | 211 |
212 browser->OpenURL(content::OpenURLParams( | 212 browser->OpenURL(content::OpenURLParams( |
213 GURL(chrome::kChromeUIDownloadsURL), content::Referrer(), | 213 GURL(chrome::kChromeUIDownloadsURL), content::Referrer(), |
214 NEW_FOREGROUND_TAB, ui::PAGE_TRANSITION_LINK, | 214 NEW_FOREGROUND_TAB, ui::PAGE_TRANSITION_LINK, |
215 false /* is_renderer_initiated */)); | 215 false /* is_renderer_initiated */)); |
216 } | 216 } |
OLD | NEW |