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

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: Add a TODO comment about ArcServiceManager 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..7e9023ada4ea2575660349efadc21025ff0f8869
--- /dev/null
+++ b/chrome/browser/chromeos/arc/notification/arc_notification_item.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 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 "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;
+
+ void UpdateWithArcNotificationData(const arc::ArcNotificationData& data);
+
+ // 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* const manager_;
hidehiko 2015/12/11 05:18:00 nit: Personally, I rarely see "const" after "*" in
yoshiki 2015/12/14 15:19:29 As I grep'd, it is used many time in Chromium. I t
+ message_center::MessageCenter* const message_center_;
+ Profile* const profile_;
+
+ std::string notification_id_;
+ std::string notification_key_;
+ scoped_ptr<message_center::Notification> notification_;
+
+ 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