OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2017 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 UI_ARC_NOTIFICATION_ARC_CUSTOM_DELEGATE_H_ | |
6 #define UI_ARC_NOTIFICATION_ARC_CUSTOM_DELEGATE_H_ | |
7 | |
8 #include "base/memory/ptr_util.h" | |
9 #include "base/memory/weak_ptr.h" | |
10 #include "ui/arc/notification/arc_notification_item.h" | |
11 #include "ui/message_center/notification_delegate.h" | |
12 | |
13 namespace arc { | |
14 | |
15 class ArcNotificationDelegate : public message_center::NotificationDelegate { | |
hidehiko
2017/05/01 12:29:17
Document about this class?
yoshiki
2017/05/08 06:24:52
Done.
| |
16 public: | |
17 explicit ArcNotificationDelegate(base::WeakPtr<ArcNotificationItem> item); | |
18 | |
19 std::unique_ptr<message_center::CustomContent> CreateCustomContent() override; | |
hidehiko
2017/05/01 12:29:17
// message_center::NotificationDelegate overrides:
yoshiki
2017/05/08 06:24:52
Done.
| |
20 void Close(bool by_user) override; | |
21 void Click() override; | |
22 | |
23 private: | |
24 // The destructor is private since this class is ref-counted. | |
25 ~ArcNotificationDelegate() override; | |
26 | |
27 base::WeakPtr<ArcNotificationItem> item_; | |
hidehiko
2017/05/01 12:29:17
You use WeakPtr here, but all methods assumes (DCH
yoshiki
2017/05/08 06:24:52
I want to keep the weak ptr to detect a potential
hidehiko
2017/05/08 09:34:41
I see. Would you mind to comment the goal of WeakP
| |
28 | |
29 DISALLOW_COPY_AND_ASSIGN(ArcNotificationDelegate); | |
hidehiko
2017/05/01 12:29:17
missing base/macros.h
yoshiki
2017/05/08 06:24:53
Done.
| |
30 }; | |
31 | |
32 } // namespace arc | |
33 | |
34 #endif // UI_ARC_NOTIFICATION_ARC_CUSTOM_DELEGATE_H_ | |
OLD | NEW |