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); |
} |