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

Unified Diff: chrome/browser/extensions/api/notifications/notifications_api.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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/api/notifications/notifications_api.cc
diff --git a/chrome/browser/extensions/api/notifications/notifications_api.cc b/chrome/browser/extensions/api/notifications/notifications_api.cc
index b870ce898523ec6848cf56a46bbf29e244457af3..8327bbd04c0949af44b697e1c0d2e4e4f2111861 100644
--- a/chrome/browser/extensions/api/notifications/notifications_api.cc
+++ b/chrome/browser/extensions/api/notifications/notifications_api.cc
@@ -305,8 +305,9 @@ bool NotificationsApiFunction::CreateNotification(
}
if (options->context_message) {
- optional_fields.context_message =
+ optional_fields.context_message.message =
base::UTF8ToUTF16(*options->context_message);
+ optional_fields.context_message.use_origin_as_context = false;
}
bool has_image = options->image_bitmap.get() &&
@@ -358,18 +359,12 @@ bool NotificationsApiFunction::CreateNotification(
NotificationsApiDelegate* api_delegate(new NotificationsApiDelegate(
this, GetProfile(), extension_->id(), id)); // ownership is passed to
// Notification
- Notification notification(type,
- extension_->url(),
- title,
- message,
- icon,
- message_center::NotifierId(
- message_center::NotifierId::APPLICATION,
- extension_->id()),
- base::UTF8ToUTF16(extension_->name()),
- api_delegate->id(),
- optional_fields,
- api_delegate);
+ Notification notification(
+ type, title, message, icon,
+ message_center::NotifierId(message_center::NotifierId::APPLICATION,
+ extension_->id()),
+ base::UTF8ToUTF16(extension_->name()), extension_->url(),
+ api_delegate->id(), optional_fields, api_delegate);
g_browser_process->notification_ui_manager()->Add(notification, GetProfile());
return true;
@@ -443,7 +438,8 @@ bool NotificationsApiFunction::UpdateNotification(
if (options->context_message) {
notification->set_context_message(
- base::UTF8ToUTF16(*options->context_message));
+ base::UTF8ToUTF16(*options->context_message),
+ false /* use_origin_as_context */);
}
gfx::Image image;

Powered by Google App Engine
This is Rietveld 408576698