| Index: components/arc/notification/arc_notification_item.h
|
| diff --git a/components/arc/notification/arc_notification_item.h b/components/arc/notification/arc_notification_item.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..f8e21af0f507f9c08c7ca8479a5af4204ddd049b
|
| --- /dev/null
|
| +++ b/components/arc/notification/arc_notification_item.h
|
| @@ -0,0 +1,60 @@
|
| +// 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_ITEM_H_
|
| +#define COMPONENTS_ARC_NOTIFICATION_ARC_NOTIFICATION_ITEM_H_
|
| +
|
| +#include <string>
|
| +
|
| +#include "base/macros.h"
|
| +#include "base/memory/weak_ptr.h"
|
| +#include "components/arc/notification/arc_notification_manager.h"
|
| +#include "components/signin/core/account_id/account_id.h"
|
| +#include "third_party/skia/include/core/SkBitmap.h"
|
| +#include "ui/message_center/message_center.h"
|
| +
|
| +namespace arc {
|
| +
|
| +class ArcNotificationItem {
|
| + public:
|
| + ArcNotificationItem(ArcNotificationManager* manager,
|
| + message_center::MessageCenter* message_center,
|
| + const arc::ArcNotificationData& data,
|
| + const AccountId& profile_id);
|
| + ~ArcNotificationItem();
|
| +
|
| + void UpdateWithArcNotificationData(const arc::ArcNotificationData& data);
|
| +
|
| + // Methods called from ArcNotificationManager:
|
| + void OnClosedFromAndroid();
|
| +
|
| + // Methods called from ArcNotificationItemDelegate:
|
| + void Close(bool by_user);
|
| + void Click();
|
| +
|
| + private:
|
| + void OnImageDecoded(const SkBitmap& bitmap);
|
| +
|
| + ArcNotificationManager* const manager_;
|
| + message_center::MessageCenter* const message_center_;
|
| + const AccountId profile_id_;
|
| +
|
| + std::string notification_key_;
|
| + std::string notification_id_;
|
| +
|
| + // Stores the on-going notification data during the image decoding.
|
| + scoped_ptr<message_center::Notification> notification_;
|
| +
|
| + // Stores the latest notification data which is newer than the on-going data.
|
| + // If the on-going data is either none or the latest, this is null.
|
| + arc::ArcNotificationDataPtr newer_data_;
|
| +
|
| + base::WeakPtrFactory<ArcNotificationItem> weak_ptr_factory_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(ArcNotificationItem);
|
| +};
|
| +
|
| +} // namespace arc
|
| +
|
| +#endif // COMPONENTS_ARC_NOTIFICATION_ARC_NOTIFICATION_ITEM_H_
|
|
|