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

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

Issue 2357053002: Always use arc::InstanceHolder<T>::GetInstanceForMethod (Closed)
Patch Set: review Created 4 years, 3 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 f30dfbdd9286b554a668959f06ac466b501017f5..c982bf99cab76b60fc641dd83c06ba35684b9af7 100644
--- a/ui/arc/notification/arc_notification_manager.cc
+++ b/ui/arc/notification/arc_notification_manager.cc
@@ -49,11 +49,9 @@ void ArcNotificationManager::OnInstanceReady() {
DCHECK(!ready_);
auto* notifications_instance =
- arc_bridge_service()->notifications()->instance();
- if (!notifications_instance) {
- VLOG(2) << "Request to refresh app list when bridge service is not ready.";
+ arc_bridge_service()->notifications()->GetInstanceForMethod("Init");
+ if (!notifications_instance)
return;
- }
notifications_instance->Init(binding_.CreateInterfacePtrAndBind());
ready_ = true;
@@ -122,7 +120,8 @@ void ArcNotificationManager::SendNotificationRemovedFromChrome(
items_.erase(it);
auto* notifications_instance =
- arc_bridge_service()->notifications()->instance();
+ arc_bridge_service()->notifications()->GetInstanceForMethod(
+ "SendNotificationEventToAndroid");
// On shutdown, the ARC channel may quit earlier then notifications.
if (!notifications_instance) {
@@ -144,7 +143,8 @@ void ArcNotificationManager::SendNotificationClickedOnChrome(
}
auto* notifications_instance =
- arc_bridge_service()->notifications()->instance();
+ arc_bridge_service()->notifications()->GetInstanceForMethod(
+ "SendNotificationEventToAndroid");
// On shutdown, the ARC channel may quit earlier then notifications.
if (!notifications_instance) {
@@ -167,7 +167,8 @@ void ArcNotificationManager::SendNotificationButtonClickedOnChrome(
}
auto* notifications_instance =
- arc_bridge_service()->notifications()->instance();
+ arc_bridge_service()->notifications()->GetInstanceForMethod(
+ "SendNotificationEventToAndroid");
// On shutdown, the ARC channel may quit earlier then notifications.
if (!notifications_instance) {
« components/arc/instance_holder.h ('K') | « components/arc/power/arc_power_bridge.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698