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

Unified Diff: components/arc/notification/arc_notification_manager.h

Issue 1477733002: Add ArcNotificationManager for new ARC notification (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase 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
Index: components/arc/notification/arc_notification_manager.h
diff --git a/components/arc/notification/arc_notification_manager.h b/components/arc/notification/arc_notification_manager.h
new file mode 100644
index 0000000000000000000000000000000000000000..dd6a18d49d3a26a125e3c804504266a951187c2c
--- /dev/null
+++ b/components/arc/notification/arc_notification_manager.h
@@ -0,0 +1,55 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef COMPONENTS_ARC_NOTIFICATION_ARC_NOTIFICATION_MANAGER_H_
+#define COMPONENTS_ARC_NOTIFICATION_ARC_NOTIFICATION_MANAGER_H_
+
+#include <map>
+#include <string>
+
+#include "base/containers/scoped_ptr_hash_map.h"
+#include "components/arc/arc_bridge_service.h"
+#include "components/arc/common/notifications.mojom.h"
+#include "components/signin/core/account_id/account_id.h"
+#include "mojo/public/cpp/bindings/binding.h"
+
+namespace arc {
+
+class ArcNotificationItem;
+
+class ArcNotificationManager : public ArcBridgeService::Observer,
+ public NotificationsHost {
+ public:
+ explicit ArcNotificationManager(ArcBridgeService* bridge_service,
dcheng 2015/12/30 19:19:35 Nit: no explicit
yoshiki 2016/01/05 10:12:14 Done.
+ const AccountId& main_profile_id);
+ ~ArcNotificationManager() override;
+
+ // ArcBridgeService::Observer implementation:
+ // void OnStateChanged(ArcBridgeService::State state) override;
+ void OnNotificationsInstanceReady() override;
+
+ // NotificationsHost implementation:
+ void OnNotificationPosted(ArcNotificationDataPtr data) override;
+ void OnNotificationRemoved(const mojo::String& key) override;
+
+ // Methods called from ArcNotificationItem:
+ void SendNotificationRemovedFromChrome(const std::string& key);
+ void SendNotificationClickedOnChrome(const std::string& key);
+
+ private:
+ ArcBridgeService* const arc_bridge_;
+ const AccountId main_profile_id_;
+
+ typedef base::ScopedPtrHashMap<std::string, scoped_ptr<ArcNotificationItem>>
+ Items;
+ Items items_;
+
+ mojo::Binding<arc::NotificationsHost> binding_;
+
+ DISALLOW_COPY_AND_ASSIGN(ArcNotificationManager);
+};
+
+} // namespace arc
+
+#endif // COMPONENTS_ARC_NOTIFICATION_ARC_NOTIFICATION_MANAGER_H_

Powered by Google App Engine
This is Rietveld 408576698