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

Side by Side Diff: components/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: . 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef COMPONENTS_ARC_NOTIFICATION_ARC_NOTIFICATION_ITEM_H_
6 #define COMPONENTS_ARC_NOTIFICATION_ARC_NOTIFICATION_ITEM_H_
7
8 #include <string>
9
10 #include "base/macros.h"
11 #include "base/memory/weak_ptr.h"
12 #include "components/arc/notification/arc_notification_manager.h"
13 #include "components/signin/core/account_id/account_id.h"
14 #include "third_party/skia/include/core/SkBitmap.h"
15 #include "ui/message_center/message_center.h"
16
17 namespace arc {
18
19 class ArcNotificationItem {
20 public:
21 ArcNotificationItem(ArcNotificationManager* manager,
22 message_center::MessageCenter* message_center,
23 const arc::ArcNotificationData& data,
24 const AccountId& profile_id);
25 ~ArcNotificationItem();
26
27 void UpdateWithArcNotificationData(const arc::ArcNotificationData& data);
28
29 // Methods called from ArcNotificationManager:
30 void OnClosedFromAndroid();
31
32 // Methods called from ArcNotificationItemDelegate:
33 void Close(bool by_user);
34 void Click();
35
36 private:
37 void OnImageDecoded(const SkBitmap& bitmap);
38
39 ArcNotificationManager* const manager_;
40 message_center::MessageCenter* const message_center_;
41 const AccountId profile_id_;
42
43 std::string notification_key_;
44 std::string notification_id_;
45
46 // Stores the on-going notification data during the image decoding.
47 scoped_ptr<message_center::Notification> notification_;
48
49 // Stores the latest notification data which is newer than the on-going data.
50 // If the on-going data is either none or the latest, this is null.
51 arc::ArcNotificationDataPtr newer_data_;
52
53 base::WeakPtrFactory<ArcNotificationItem> weak_ptr_factory_;
54
55 DISALLOW_COPY_AND_ASSIGN(ArcNotificationItem);
56 };
57
58 } // namespace arc
59
60 #endif // COMPONENTS_ARC_NOTIFICATION_ARC_NOTIFICATION_ITEM_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698