Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef UI_MESSAGE_CENTER_VIEWS_CUSTOM_NOTIFICATION_VIEW_H_ | 5 #ifndef UI_MESSAGE_CENTER_VIEWS_CUSTOM_NOTIFICATION_VIEW_H_ |
| 6 #define UI_MESSAGE_CENTER_VIEWS_CUSTOM_NOTIFICATION_VIEW_H_ | 6 #define UI_MESSAGE_CENTER_VIEWS_CUSTOM_NOTIFICATION_VIEW_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "ui/message_center/message_center_export.h" | 9 #include "ui/message_center/message_center_export.h" |
| 10 #include "ui/message_center/views/message_view.h" | 10 #include "ui/message_center/views/message_view.h" |
| 11 | 11 |
| 12 namespace message_center { | 12 namespace message_center { |
| 13 | 13 |
| 14 // View for notification with NOTIFICATION_TYPE_CUSTOM that hosts the custom | 14 // View for notification with NOTIFICATION_TYPE_CUSTOM that hosts the custom |
| 15 // content of the notification. | 15 // content of the notification. |
| 16 class MESSAGE_CENTER_EXPORT CustomNotificationView : public MessageView { | 16 class MESSAGE_CENTER_EXPORT CustomNotificationView : public MessageView { |
| 17 public: | 17 public: |
| 18 CustomNotificationView(MessageCenterController* controller, | 18 CustomNotificationView(MessageCenterController* controller, |
| 19 const Notification& notification); | 19 const Notification& notification); |
| 20 ~CustomNotificationView() override; | 20 ~CustomNotificationView() override; |
| 21 | 21 |
| 22 // Overidden from MessageView: | 22 // Overidden from MessageView: |
| 23 void SetDrawBackgroundAsActive(bool active) override; | 23 void SetDrawBackgroundAsActive(bool active) override; |
| 24 bool IsCloseButtonFocused() const override; | |
| 25 void RequestFocusOnCloseButton() override; | |
| 26 bool IsPinned() const override; | |
| 24 | 27 |
| 25 // Overridden from views::View: | 28 // Overridden from views::View: |
| 26 gfx::Size GetPreferredSize() const override; | 29 gfx::Size GetPreferredSize() const override; |
| 27 void Layout() override; | 30 void Layout() override; |
| 28 | 31 |
| 29 private: | 32 private: |
| 30 friend class CustomNotificationViewTest; | 33 friend class CustomNotificationViewTest; |
| 31 | 34 |
| 32 // The view for the custom content. Owned by view hierarchy. | 35 // The view for the custom content. Owned by view hierarchy. |
| 33 views::View* contents_view_ = nullptr; | 36 views::View* contents_view_ = nullptr; |
| 37 std::unique_ptr<CustomNotificationContentViewDelegate> | |
| 38 contents_view_delegate_ = nullptr; | |
|
yoshiki
2016/12/06 05:28:27
Assigning nullptr is not necessary here.
yhanada
2016/12/06 06:41:26
Done.
| |
| 34 | 39 |
| 35 DISALLOW_COPY_AND_ASSIGN(CustomNotificationView); | 40 DISALLOW_COPY_AND_ASSIGN(CustomNotificationView); |
| 36 }; | 41 }; |
| 37 | 42 |
| 38 } // namespace message_center | 43 } // namespace message_center |
| 39 | 44 |
| 40 #endif // UI_MESSAGE_CENTER_VIEWS_CUSTOM_NOTIFICATION_VIEW_H_ | 45 #endif // UI_MESSAGE_CENTER_VIEWS_CUSTOM_NOTIFICATION_VIEW_H_ |
| OLD | NEW |