diff options
author | peter <peter@chromium.org> | 2014-10-15 08:14:22 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-10-15 15:15:06 +0000 |
commit | d17f01a45c92d94869750d7cefb23aa73ed9514d (patch) | |
tree | 95e85246d315c46035b97951e0146f7a83a5f06d /chrome/browser/notifications/notification.cc | |
parent | 743a470b92f42a50664b8aa48151638ed3607868 (diff) | |
download | chromium_src-d17f01a45c92d94869750d7cefb23aa73ed9514d.zip chromium_src-d17f01a45c92d94869750d7cefb23aa73ed9514d.tar.gz chromium_src-d17f01a45c92d94869750d7cefb23aa73ed9514d.tar.bz2 |
Request the icon of a Web Notification in the renderer process.
This will allow us to move the URL fetching logic out of /c/b/notifications/.
Mind that this code will soon move to //content/child/, so we can't
re-use some of the existing image fetching logic in //content/renderer/.
BUG=
Review URL: https://codereview.chromium.org/554213003
Cr-Commit-Position: refs/heads/master@{#299685}
Diffstat (limited to 'chrome/browser/notifications/notification.cc')
-rw-r--r-- | chrome/browser/notifications/notification.cc | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/chrome/browser/notifications/notification.cc b/chrome/browser/notifications/notification.cc index efa2332..22e79e4 100644 --- a/chrome/browser/notifications/notification.cc +++ b/chrome/browser/notifications/notification.cc @@ -5,10 +5,9 @@ #include "chrome/browser/notifications/notification.h" Notification::Notification(const GURL& origin_url, - const GURL& icon_url, const base::string16& title, const base::string16& body, - blink::WebTextDirection dir, + const gfx::Image& icon, const base::string16& display_source, const base::string16& replace_id, NotificationDelegate* delegate) @@ -16,13 +15,12 @@ Notification::Notification(const GURL& origin_url, delegate->id(), title, body, - gfx::Image(), + icon, display_source, message_center::NotifierId(origin_url), message_center::RichNotificationData(), delegate), origin_url_(origin_url), - icon_url_(icon_url), replace_id_(replace_id), delegate_(delegate) {} @@ -49,16 +47,12 @@ Notification::Notification( delegate), origin_url_(origin_url), replace_id_(replace_id), - delegate_(delegate) { - // It's important to leave |icon_url_| empty with rich notifications enabled, - // to prevent "Downloading" the data url and overwriting the existing |icon|. -} + delegate_(delegate) {} Notification::Notification(const std::string& id, const Notification& notification) : message_center::Notification(id, notification), origin_url_(notification.origin_url()), - icon_url_(notification.icon_url()), button_one_icon_url_(notification.button_one_icon_url()), button_two_icon_url_(notification.button_two_icon_url()), image_url_(notification.image_url()), @@ -69,7 +63,6 @@ Notification::Notification(const std::string& id, Notification::Notification(const Notification& notification) : message_center::Notification(notification), origin_url_(notification.origin_url()), - icon_url_(notification.icon_url()), button_one_icon_url_(notification.button_one_icon_url()), button_two_icon_url_(notification.button_two_icon_url()), image_url_(notification.image_url()), @@ -81,7 +74,6 @@ Notification::~Notification() {} Notification& Notification::operator=(const Notification& notification) { message_center::Notification::operator=(notification); origin_url_ = notification.origin_url(); - icon_url_ = notification.icon_url(); button_one_icon_url_ = notification.button_one_icon_url(); button_two_icon_url_ = notification.button_two_icon_url(); image_url_ = notification.image_url(); |