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

Unified Diff: components/arc/arc_bridge_service.h

Issue 1475583002: Add IPC messages for ARC notification (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed the comments and splitted the patch Created 5 years, 1 month 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: components/arc/arc_bridge_service.h
diff --git a/components/arc/arc_bridge_service.h b/components/arc/arc_bridge_service.h
index e3417bc985756c0db52044b339df84c9da3d350b..2f962f06f92cf1bb6a4cc3bbf697abbda7ffb516 100644
--- a/components/arc/arc_bridge_service.h
+++ b/components/arc/arc_bridge_service.h
@@ -8,6 +8,7 @@
#include "base/macros.h"
#include "base/observer_list.h"
#include "base/sequenced_task_runner.h"
+#include "components/arc/common/arc_notification_types.h"
#include "ipc/ipc_channel_proxy.h"
#include "ipc/ipc_listener.h"
#include "ipc/ipc_message.h"
@@ -67,6 +68,13 @@ class ArcBridgeService : public IPC::Listener {
// Called whenever ARC's availability has changed for this system.
virtual void OnAvailableChanged(bool available) {}
+ // Called whenever a notification has been posted on Android side. This
+ // event is used for both creation and update.
+ virtual void OnNotificationPostedFromAndroid(
+ const ArcNotificationData& data) {}
+ // Called whenever a notification has been removed on Android side.
+ virtual void OnNotificationRemovedFromAndroid(const std::string& key) {}
+
protected:
virtual ~Observer() {}
};
@@ -115,6 +123,9 @@ class ArcBridgeService : public IPC::Listener {
const std::string& device_type,
base::ScopedFD fd);
+ // Notifys a notification event to Android side.
+ bool NotifyNotificationEvent(const std::string& key, NotificationEvent event);
+
private:
friend class ArcBridgeTest;
FRIEND_TEST_ALL_PREFIXES(ArcBridgeTest, Basic);
@@ -148,6 +159,11 @@ class ArcBridgeService : public IPC::Listener {
// interaction.
void OnInstanceReady();
+ // Handler for ArcInstanceHostMsg_NotificationPosted message.
+ void OnNotificationPosted(const ArcNotificationData& data);
+ // Handler for ArcInstanceHostMsg_NotificationRemoved message.
+ void OnNotificationRemoved(const std::string& key);
+
// Changes the current state and notifies all observers.
void SetState(State state);

Powered by Google App Engine
This is Rietveld 408576698