Index: ui/arc/notification/arc_notification_item_impl.h |
diff --git a/ui/arc/notification/arc_notification_item.h b/ui/arc/notification/arc_notification_item_impl.h |
similarity index 64% |
copy from ui/arc/notification/arc_notification_item.h |
copy to ui/arc/notification/arc_notification_item_impl.h |
index 3df5e6aaed430ea60574cbbee2f3272f9408389c..5111ef0c28e0094653d6d63c85d1e0156f875664 100644 |
--- a/ui/arc/notification/arc_notification_item.h |
+++ b/ui/arc/notification/arc_notification_item_impl.h |
@@ -1,9 +1,9 @@ |
-// Copyright 2016 The Chromium Authors. All rights reserved. |
+// Copyright 2017 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 UI_ARC_NOTIFICATION_ARC_NOTIFICATION_ITEM_H_ |
-#define UI_ARC_NOTIFICATION_ARC_NOTIFICATION_ITEM_H_ |
+#ifndef UI_ARC_NOTIFICATION_ARC_NOTIFICATION_ITEM_IMPL_H_ |
+#define UI_ARC_NOTIFICATION_ARC_NOTIFICATION_ITEM_IMPL_H_ |
#include <memory> |
#include <string> |
@@ -13,6 +13,7 @@ |
#include "base/threading/thread_checker.h" |
#include "components/signin/core/account_id/account_id.h" |
#include "third_party/skia/include/core/SkBitmap.h" |
+#include "ui/arc/notification/arc_notification_item.h" |
#include "ui/arc/notification/arc_notification_manager.h" |
#include "ui/message_center/message_center.h" |
@@ -20,27 +21,31 @@ namespace arc { |
// The class represents each ARC notification. One instance of this class |
// corresponds to one ARC notification. |
-class ArcNotificationItem { |
+class ArcNotificationItemImpl : public ArcNotificationItem { |
public: |
- ArcNotificationItem(ArcNotificationManager* manager, |
- message_center::MessageCenter* message_center, |
- const std::string& notification_key, |
- const AccountId& profile_id); |
- virtual ~ArcNotificationItem(); |
+ ArcNotificationItemImpl(ArcNotificationManager* manager, |
+ message_center::MessageCenter* message_center, |
+ const std::string& notification_key, |
+ const AccountId& profile_id); |
+ ~ArcNotificationItemImpl() override; |
- virtual void UpdateWithArcNotificationData( |
- mojom::ArcNotificationDataPtr data); |
+ void UpdateWithArcNotificationData( |
+ mojom::ArcNotificationDataPtr data) override; |
- // Methods called from ArcNotificationManager: |
- void OnClosedFromAndroid(); |
+ void OnClosedFromAndroid() override; |
+ void Close(bool by_user) override; |
+ void CloseFromCloseButton() override; |
+ void OpenSettings() override; |
- // Methods called from ArcNotificationItemDelegate: |
- void Close(bool by_user); |
- void Click(); |
- void ButtonClick(int button_index); |
- void OpenSettings(); |
+ void AddObserver(Observer* observer) override; |
+ void RemoveObserver(Observer* observer) override; |
- const std::string& notification_key() const { return notification_key_; } |
+ void IncrementWindowRefCount() override; |
+ void DecrementWindowRefCount() override; |
+ |
+ bool pinned() const override; |
+ const gfx::ImageSkia& snapshot() const override; |
+ const std::string& notification_key() const override; |
protected: |
static int ConvertAndroidPriority(int android_priority); |
@@ -76,6 +81,12 @@ class ArcNotificationItem { |
message_center::MessageCenter* const message_center_; |
const AccountId profile_id_; |
+ bool pinned_ = false; |
+ gfx::ImageSkia snapshot_; |
+ int window_ref_count_ = 0; |
+ |
+ base::ObserverList<Observer> observers_; |
+ |
const std::string notification_key_; |
const std::string notification_id_; |
@@ -96,11 +107,11 @@ class ArcNotificationItem { |
mojom::ArcNotificationDataPtr newer_data_; |
base::ThreadChecker thread_checker_; |
- base::WeakPtrFactory<ArcNotificationItem> weak_ptr_factory_; |
+ base::WeakPtrFactory<ArcNotificationItemImpl> weak_ptr_factory_; |
- DISALLOW_COPY_AND_ASSIGN(ArcNotificationItem); |
+ DISALLOW_COPY_AND_ASSIGN(ArcNotificationItemImpl); |
}; |
} // namespace arc |
-#endif // UI_ARC_NOTIFICATION_ARC_NOTIFICATION_ITEM_H_ |
+#endif // UI_ARC_NOTIFICATION_ARC_NOTIFICATION_IMPL_ITEM_H_ |