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

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: for comments in #2 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
« no previous file with comments | « ui/arc/notification/arc_notification_item.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..34e6423f1f49d3a1ae05fb8be42b08447bf0d105 100644
--- a/ui/arc/notification/arc_notification_manager.cc
+++ b/ui/arc/notification/arc_notification_manager.cc
@@ -8,10 +8,14 @@
#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 {
+// Whether to use custom notification.
+constexpr bool use_custom_notification = true;
yoshiki 2016/06/16 02:44:50 We use custom notification only for non-standard n
xiyuan 2016/06/20 23:04:58 Added a use_custom_notification field to notificat
+
ArcNotificationManager::ArcNotificationManager(ArcBridgeService* bridge_service,
const AccountId& main_profile_id)
: ArcNotificationManager(bridge_service,
@@ -62,10 +66,14 @@ 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.
+ // 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') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698