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

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: Fixed Chrome OS build 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
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 91b8c269b2517fc2bced797f96c0d924b6744f94..5a1ccb94013e65ba998d8895a8a9ac632d1a38f4 100644
--- a/ui/arc/notification/arc_notification_manager.cc
+++ b/ui/arc/notification/arc_notification_manager.cc
@@ -14,16 +14,17 @@ ArcNotificationManager::ArcNotificationManager(ArcBridgeService* arc_bridge,
: arc_bridge_(arc_bridge),
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);
+
+ // If NotificationsInstance was ready before we AddObserver(), we won't get
+ // OnNotificationsInstanceReady events. For such case, we have to call it
+ // explicitly.
+ if (arc_bridge_->notifications_instance())
+ OnNotificationsInstanceReady();
}
ArcNotificationManager::~ArcNotificationManager() {
- // This should be free'd before ArcBridgeService.
- DCHECK(ArcBridgeService::Get());
- DCHECK_EQ(arc_bridge_, ArcBridgeService::Get());
arc_bridge_->RemoveObserver(this);
}
« components/arc/input/arc_input_bridge.h ('K') | « 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