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

Unified Diff: chrome/browser/chromeos/arc/notification/arc_notification_item.h

Issue 1477733002: Add ArcNotificationManager for new ARC notification (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix comment 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: chrome/browser/chromeos/arc/notification/arc_notification_item.h
diff --git a/chrome/browser/chromeos/arc/notification/arc_notification_item.h b/chrome/browser/chromeos/arc/notification/arc_notification_item.h
new file mode 100644
index 0000000000000000000000000000000000000000..6a29c0efb1e28525421800fb0c165ff07cb6af0d
--- /dev/null
+++ b/chrome/browser/chromeos/arc/notification/arc_notification_item.h
@@ -0,0 +1,53 @@
+// 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 CHROME_BROWSER_CHROMEOS_ARC_NOTIFICATION_ARC_NOTIFICATION_ITEM_H_
+#define CHROME_BROWSER_CHROMEOS_ARC_NOTIFICATION_ARC_NOTIFICATION_ITEM_H_
+
+#include <string>
+
+#include "base/macros.h"
+#include "base/memory/weak_ptr.h"
+#include "chrome/browser/chromeos/arc/notification/arc_notification_manager.h"
+#include "chrome/browser/image_decoder.h"
+#include "components/arc/common/arc_notification_types.h"
+#include "third_party/skia/include/core/SkBitmap.h"
+#include "ui/message_center/message_center.h"
+
+namespace chromeos {
+
+class ArcNotificationItem : public ImageDecoder::ImageRequest {
+ public:
+ ArcNotificationItem(ArcNotificationManager* manager,
+ message_center::MessageCenter* message_center,
+ const arc::ArcNotificationData& data,
+ Profile* profile);
+ ~ArcNotificationItem() override;
+
+ // Methods called from ArcNotificationManager:
+ void OnClosedFromAndroid();
+
+ // Methods called from ArcNotificationItemDelegate:
+ void Close(bool by_user);
+ void Click();
+
+ // ImageDecoder::ImageRequest implementation:
+ void OnImageDecoded(const SkBitmap& bitmap) override;
+
+ private:
+ ArcNotificationManager* manager_;
+ message_center::MessageCenter* message_center_;
+ arc::ArcNotificationData data_;
+ Profile* profile_;
+
+ std::string notification_id_;
+
+ base::WeakPtrFactory<ArcNotificationItem> weak_ptr_factory_;
+
+ DISALLOW_COPY_AND_ASSIGN(ArcNotificationItem);
+};
+
+} // namespace chromeos
+
+#endif // CHROME_BROWSER_CHROMEOS_ARC_NOTIFICATION_ARC_NOTIFICATION_ITEM_H_

Powered by Google App Engine
This is Rietveld 408576698