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

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

Issue 1596663002: arc-bridge: Introduce the ArcService class (Closed) Base URL: https://chromium.googlesource.com/a/chromium/src.git@master
Patch Set: Rebased + protected ArcService direct instantiation Created 4 years, 11 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_manager.h ('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 9c877350a3f4bb22932841a0c03511c509b16d48..a5692d54d3636226e9eed61c8c5c91c6972cb976 100644
--- a/ui/arc/notification/arc_notification_manager.cc
+++ b/ui/arc/notification/arc_notification_manager.cc
@@ -9,27 +9,21 @@
namespace arc {
-ArcNotificationManager::ArcNotificationManager(ArcBridgeService* arc_bridge,
+ArcNotificationManager::ArcNotificationManager(ArcBridgeService* bridge_service,
const AccountId& main_profile_id)
- : arc_bridge_(arc_bridge),
+ : ArcService(bridge_service),
main_profile_id_(main_profile_id),
binding_(this) {
- // This must be initialized after ArcBridgeService.
- DCHECK(arc_bridge_);
- DCHECK_EQ(arc_bridge_, ArcBridgeService::Get());
- arc_bridge_->AddObserver(this);
+ arc_bridge_service()->AddObserver(this);
}
ArcNotificationManager::~ArcNotificationManager() {
- // This should be free'd before ArcBridgeService.
- DCHECK(ArcBridgeService::Get());
- DCHECK_EQ(arc_bridge_, ArcBridgeService::Get());
- arc_bridge_->RemoveObserver(this);
+ arc_bridge_service()->RemoveObserver(this);
}
void ArcNotificationManager::OnNotificationsInstanceReady() {
NotificationsInstance* notifications_instance =
- arc_bridge_->notifications_instance();
+ arc_bridge_service()->notifications_instance();
if (!notifications_instance) {
VLOG(2) << "Request to refresh app list when bridge service is not ready.";
return;
@@ -75,8 +69,9 @@ void ArcNotificationManager::SendNotificationRemovedFromChrome(
scoped_ptr<ArcNotificationItem> item(items_.take_and_erase(it));
- arc_bridge_->notifications_instance()->SendNotificationEventToAndroid(
- key, ArcNotificationEvent::CLOSED);
+ arc_bridge_service()
+ ->notifications_instance()
+ ->SendNotificationEventToAndroid(key, ArcNotificationEvent::CLOSED);
}
void ArcNotificationManager::SendNotificationClickedOnChrome(
@@ -87,8 +82,9 @@ void ArcNotificationManager::SendNotificationClickedOnChrome(
return;
}
- arc_bridge_->notifications_instance()->SendNotificationEventToAndroid(
- key, ArcNotificationEvent::BODY_CLICKED);
+ arc_bridge_service()
+ ->notifications_instance()
+ ->SendNotificationEventToAndroid(key, ArcNotificationEvent::BODY_CLICKED);
}
} // namespace arc
« no previous file with comments | « ui/arc/notification/arc_notification_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698