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

Side by Side Diff: chrome/browser/download/notification/download_group_notification.cc

Issue 1292003004: Elide origins displayed on web notifications. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move origin_url to message_center::Notification Created 5 years, 4 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 unified diff | Download patch
OLDNEW
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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 Profile* profile, DownloadNotificationManagerForProfile* manager) 94 Profile* profile, DownloadNotificationManagerForProfile* manager)
95 : profile_(profile) { 95 : profile_(profile) {
96 96
97 ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance(); 97 ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance();
98 98
99 message_center::RichNotificationData data; 99 message_center::RichNotificationData data;
100 // Creates the notification instance. |title| and |body| will be overridden 100 // Creates the notification instance. |title| and |body| will be overridden
101 // by UpdateNotificationData() below. 101 // by UpdateNotificationData() below.
102 notification_.reset(new Notification( 102 notification_.reset(new Notification(
103 message_center::NOTIFICATION_TYPE_MULTIPLE, 103 message_center::NOTIFICATION_TYPE_MULTIPLE,
104 GURL(kDownloadNotificationOrigin), // origin_url 104 base::string16(), // title
105 base::string16(), // title 105 base::string16(), // body
106 base::string16(), // body
107 bundle.GetImageNamed(IDR_DOWNLOAD_NOTIFICATION_DOWNLOADING), 106 bundle.GetImageNamed(IDR_DOWNLOAD_NOTIFICATION_DOWNLOADING),
108 message_center::NotifierId(message_center::NotifierId::SYSTEM_COMPONENT, 107 message_center::NotifierId(message_center::NotifierId::SYSTEM_COMPONENT,
109 kDownloadNotificationNotifierId), 108 kDownloadNotificationNotifierId),
110 base::string16(), // display_source 109 base::string16(), // display_source
111 "GROUP", // tag 110 GURL(kDownloadNotificationOrigin), // origin_url
111 "GROUP", // tag
112 data, watcher())); 112 data, watcher()));
113 113
114 notification_->SetSystemPriority(); 114 notification_->SetSystemPriority();
115 notification_->set_never_timeout(false); 115 notification_->set_never_timeout(false);
116 116
117 std::vector<message_center::ButtonInfo> notification_actions; 117 std::vector<message_center::ButtonInfo> notification_actions;
118 message_center::ButtonInfo button_info = 118 message_center::ButtonInfo button_info =
119 message_center::ButtonInfo(l10n_util::GetStringUTF16( 119 message_center::ButtonInfo(l10n_util::GetStringUTF16(
120 IDS_DOWNLOAD_LINK_SHOW_ALL_DOWNLOADS)); 120 IDS_DOWNLOAD_LINK_SHOW_ALL_DOWNLOADS));
121 notification_actions.push_back(button_info); 121 notification_actions.push_back(button_info);
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 chrome::ScopedTabbedBrowserDisplayer browser_displayer( 271 chrome::ScopedTabbedBrowserDisplayer browser_displayer(
272 profile_, chrome::GetActiveDesktop()); 272 profile_, chrome::GetActiveDesktop());
273 Browser* browser = browser_displayer.browser(); 273 Browser* browser = browser_displayer.browser();
274 DCHECK(browser); 274 DCHECK(browser);
275 275
276 browser->OpenURL(content::OpenURLParams( 276 browser->OpenURL(content::OpenURLParams(
277 GURL(chrome::kChromeUIDownloadsURL), content::Referrer(), 277 GURL(chrome::kChromeUIDownloadsURL), content::Referrer(),
278 NEW_FOREGROUND_TAB, ui::PAGE_TRANSITION_LINK, 278 NEW_FOREGROUND_TAB, ui::PAGE_TRANSITION_LINK,
279 false /* is_renderer_initiated */)); 279 false /* is_renderer_initiated */));
280 } 280 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698