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

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: Rebased Created 5 years 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
« no previous file with comments | « components/arc/BUILD.gn ('k') | components/arc/arc_bridge_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/arc/arc_bridge_service.h
diff --git a/components/arc/arc_bridge_service.h b/components/arc/arc_bridge_service.h
index a3c1fe6c8dafc69e5222e84e4636da2d5ecbfd0d..b11097b3f5baf2a146bf95b5f2a831314e649c9b 100644
--- a/components/arc/arc_bridge_service.h
+++ b/components/arc/arc_bridge_service.h
@@ -10,6 +10,7 @@
#include "base/memory/scoped_ptr.h"
#include "base/observer_list.h"
#include "components/arc/common/arc_message_types.h"
+#include "components/arc/common/arc_notification_types.h"
namespace base {
class CommandLine;
@@ -80,6 +81,19 @@ class ArcBridgeService {
virtual ~Observer() {}
};
+ class NotificationObserver {
+ public:
+ // 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 ~NotificationObserver() {}
+ };
+
// Notifies ARC apps related events.
class AppObserver {
public:
@@ -129,6 +143,8 @@ class ArcBridgeService {
// class was created on.
void AddObserver(Observer* observer);
void RemoveObserver(Observer* observer);
+ void AddNotificationObserver(NotificationObserver* observer);
+ void RemoveNotificationObserver(NotificationObserver* observer);
// Adds or removes ARC app observers. This can only be called on the thread
// that this class was created on.
@@ -151,6 +167,10 @@ class ArcBridgeService {
const std::string& device_type,
base::ScopedFD fd) = 0;
+ // Sends a notification event to Android side.
+ virtual bool SendNotificationEventToAndroid(const std::string& key,
+ ArcNotificationEvent event) = 0;
+
// Requests to refresh an app list.
virtual bool RefreshAppList() = 0;
@@ -177,6 +197,9 @@ class ArcBridgeService {
}
base::ObserverList<Observer>& observer_list() { return observer_list_; }
+ base::ObserverList<NotificationObserver>& notification_observer_list() {
+ return notification_observer_list_;
+ }
base::ObserverList<AppObserver>& app_observer_list() {
return app_observer_list_;
@@ -186,6 +209,7 @@ class ArcBridgeService {
scoped_refptr<base::SequencedTaskRunner> origin_task_runner_;
base::ObserverList<Observer> observer_list_;
+ base::ObserverList<NotificationObserver> notification_observer_list_;
base::ObserverList<AppObserver> app_observer_list_;
« no previous file with comments | « components/arc/BUILD.gn ('k') | components/arc/arc_bridge_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698