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

Unified Diff: ui/arc/notification/arc_notification_manager.cc

Issue 2066853002: arc: Show custom notification via notification surface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@notification-exo
Patch Set: rebase Created 4 years, 6 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: ui/arc/notification/arc_notification_manager.cc
diff --git a/ui/arc/notification/arc_notification_manager.cc b/ui/arc/notification/arc_notification_manager.cc
index b27e2c563746f09a2afb0398b278a4869fbe0843..a6e3fa55d7130ed0b1a8619182b5ff59a2836981 100644
--- a/ui/arc/notification/arc_notification_manager.cc
+++ b/ui/arc/notification/arc_notification_manager.cc
@@ -8,6 +8,7 @@
#include "ash/system/toast/toast_manager.h"
#include "base/memory/ptr_util.h"
#include "base/stl_util.h"
+#include "ui/arc/notification/arc_custom_notification_item.h"
#include "ui/arc/notification/arc_notification_item.h"
namespace arc {
@@ -62,10 +63,17 @@ void ArcNotificationManager::OnNotificationPosted(
const std::string& key = data->key;
auto it = items_.find(key);
if (it == items_.end()) {
- // Show a notification on the primary loged-in user's desktop.
+ // Old client with version < 5 would have use_custom_notification default,
+ // which is false.
+ const bool use_custom_notification = data->use_custom_notification;
+ // Show a notification on the primary logged-in user's desktop.
// TODO(yoshiki): Reconsider when ARC supports multi-user.
ArcNotificationItem* item =
- new ArcNotificationItem(this, message_center_, key, main_profile_id_);
+ use_custom_notification
+ ? new ArcCustomNotificationItem(this, message_center_, key,
+ main_profile_id_)
+ : new ArcNotificationItem(this, message_center_, key,
+ main_profile_id_);
// TODO(yoshiki): Use emplacement for performance when it's available.
auto result = items_.insert(std::make_pair(key, base::WrapUnique(item)));
DCHECK(result.second);
« no previous file with comments | « ui/arc/notification/arc_notification_item.cc ('k') | ui/arc/notification/arc_notification_surface_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698