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

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

Issue 2133503002: arc: Revamp the ArcBridgeService interface (Closed) Base URL: https://chromium.googlesource.com/a/chromium/src.git@master
Patch Set: More rebasing Created 4 years, 5 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 a6e3fa55d7130ed0b1a8619182b5ff59a2836981..0c226ce868260961fe77e89dbdba8ecb2b99dedb 100644
--- a/ui/arc/notification/arc_notification_manager.cc
+++ b/ui/arc/notification/arc_notification_manager.cc
@@ -27,17 +27,18 @@ ArcNotificationManager::ArcNotificationManager(
main_profile_id_(main_profile_id),
message_center_(message_center),
binding_(this) {
- arc_bridge_service()->AddObserver(this);
+ arc_bridge_service()->notifications()->AddObserver(this);
}
ArcNotificationManager::~ArcNotificationManager() {
- arc_bridge_service()->RemoveObserver(this);
+ arc_bridge_service()->notifications()->RemoveObserver(this);
}
-void ArcNotificationManager::OnNotificationsInstanceReady() {
+void ArcNotificationManager::OnInstanceReady() {
DCHECK(!ready_);
- auto notifications_instance = arc_bridge_service()->notifications_instance();
+ auto notifications_instance =
+ arc_bridge_service()->notifications()->instance();
if (!notifications_instance) {
VLOG(2) << "Request to refresh app list when bridge service is not ready.";
return;
@@ -47,7 +48,7 @@ void ArcNotificationManager::OnNotificationsInstanceReady() {
ready_ = true;
}
-void ArcNotificationManager::OnNotificationsInstanceClosed() {
+void ArcNotificationManager::OnInstanceClosed() {
DCHECK(ready_);
while (!items_.empty()) {
auto it = items_.begin();
@@ -109,7 +110,8 @@ void ArcNotificationManager::SendNotificationRemovedFromChrome(
std::unique_ptr<ArcNotificationItem> item = std::move(it->second);
items_.erase(it);
- auto notifications_instance = arc_bridge_service()->notifications_instance();
+ auto notifications_instance =
+ arc_bridge_service()->notifications()->instance();
// On shutdown, the ARC channel may quit earlier then notifications.
if (!notifications_instance) {
@@ -130,7 +132,8 @@ void ArcNotificationManager::SendNotificationClickedOnChrome(
return;
}
- auto notifications_instance = arc_bridge_service()->notifications_instance();
+ auto notifications_instance =
+ arc_bridge_service()->notifications()->instance();
// On shutdown, the ARC channel may quit earlier then notifications.
if (!notifications_instance) {
@@ -144,14 +147,16 @@ void ArcNotificationManager::SendNotificationClickedOnChrome(
}
void ArcNotificationManager::SendNotificationButtonClickedOnChrome(
- const std::string& key, int button_index) {
+ const std::string& key,
+ int button_index) {
if (items_.find(key) == items_.end()) {
VLOG(3) << "Chrome requests to fire a click event on notification (key: "
<< key << "), but it is gone.";
return;
}
- auto notifications_instance = arc_bridge_service()->notifications_instance();
+ auto notifications_instance =
+ arc_bridge_service()->notifications()->instance();
// On shutdown, the ARC channel may quit earlier then notifications.
if (!notifications_instance) {
@@ -178,8 +183,8 @@ void ArcNotificationManager::SendNotificationButtonClickedOnChrome(
command = mojom::ArcNotificationEvent::BUTTON_5_CLICKED;
break;
default:
- VLOG(3) << "Invalid button index (key: " << key << ", index: " <<
- button_index << ").";
+ VLOG(3) << "Invalid button index (key: " << key
+ << ", index: " << button_index << ").";
return;
}
« no previous file with comments | « ui/arc/notification/arc_notification_manager.h ('k') | ui/arc/notification/arc_notification_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698