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

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: Remove the use_origin flag in Notification do everything in NotificationView 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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698