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

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

Issue 2845003002: Merge ArcNotificationItem and ArcCustomNotificationItem (Closed)
Patch Set: Rebased Created 3 years, 7 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_impl.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 7f63ba2a09656ee76f3274fd1a820b3d21f46c6f..91a2b4f87e9f533f50c158037338aef45ea059aa 100644
--- a/ui/arc/notification/arc_notification_manager.cc
+++ b/ui/arc/notification/arc_notification_manager.cc
@@ -13,8 +13,7 @@
#include "base/stl_util.h"
#include "base/strings/utf_string_conversions.h"
#include "components/arc/arc_bridge_service.h"
-#include "ui/arc/notification/arc_custom_notification_item.h"
-#include "ui/arc/notification/arc_notification_item.h"
+#include "ui/arc/notification/arc_notification_item_impl.h"
namespace arc {
@@ -66,23 +65,16 @@ void ArcNotificationManager::OnNotificationPosted(
const std::string& key = data->key;
auto it = items_.find(key);
if (it == items_.end()) {
- // 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 =
- use_custom_notification
- ? new ArcCustomNotificationItem(this, message_center_, key,
- main_profile_id_)
- : new ArcNotificationItem(this, message_center_, key,
- main_profile_id_);
+ auto item = base::MakeUnique<ArcNotificationItemImpl>(
+ 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)));
+ auto result = items_.insert(std::make_pair(key, std::move(item)));
DCHECK(result.second);
it = result.first;
}
- it->second->UpdateWithArcNotificationData(std::move(data));
+ it->second->OnUpdatedFromAndroid(std::move(data));
}
void ArcNotificationManager::OnNotificationRemoved(const std::string& key) {
« no previous file with comments | « ui/arc/notification/arc_notification_item_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698