| 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" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 | 27 |
| 28 CustomNotificationView(MessageCenterController* controller, | 28 CustomNotificationView(MessageCenterController* controller, |
| 29 const Notification& notification); | 29 const Notification& notification); |
| 30 ~CustomNotificationView() override; | 30 ~CustomNotificationView() override; |
| 31 | 31 |
| 32 // These method are called by the content view when focus handling is defered | 32 // These method are called by the content view when focus handling is defered |
| 33 // to the content. | 33 // to the content. |
| 34 void OnContentFocused(); | 34 void OnContentFocused(); |
| 35 void OnContentBlured(); | 35 void OnContentBlured(); |
| 36 | 36 |
| 37 // Overidden from MessageView: | 37 // Overridden from MessageView: |
| 38 void SetDrawBackgroundAsActive(bool active) override; | 38 void SetDrawBackgroundAsActive(bool active) override; |
| 39 bool IsCloseButtonFocused() const override; | 39 bool IsCloseButtonFocused() const override; |
| 40 void RequestFocusOnCloseButton() override; | 40 void RequestFocusOnCloseButton() override; |
| 41 void UpdateControlButtonsVisibility() override; | 41 void UpdateControlButtonsVisibility() override; |
| 42 // views::SlideOutController::Delegate: |
| 43 void OnSlideChanged() override; |
| 42 | 44 |
| 43 // Overridden from views::View: | 45 // Overridden from views::View: |
| 44 const char* GetClassName() const override; | 46 const char* GetClassName() const override; |
| 45 gfx::Size GetPreferredSize() const override; | 47 gfx::Size GetPreferredSize() const override; |
| 46 void Layout() override; | 48 void Layout() override; |
| 47 bool HasFocus() const override; | 49 bool HasFocus() const override; |
| 48 void RequestFocus() override; | 50 void RequestFocus() override; |
| 49 void OnPaint(gfx::Canvas* canvas) override; | 51 void OnPaint(gfx::Canvas* canvas) override; |
| 50 bool OnKeyPressed(const ui::KeyEvent& event) override; | 52 bool OnKeyPressed(const ui::KeyEvent& event) override; |
| 51 void ChildPreferredSizeChanged(View* child) override; | 53 void ChildPreferredSizeChanged(View* child) override; |
| 52 bool HandleAccessibleAction(const ui::AXActionData& action) override; | 54 bool HandleAccessibleAction(const ui::AXActionData& action) override; |
| 53 | 55 |
| 54 private: | 56 private: |
| 55 friend class CustomNotificationViewTest; | 57 friend class CustomNotificationViewTest; |
| 56 | 58 |
| 57 // The view for the custom content. Owned by view hierarchy. | 59 // The view for the custom content. Owned by view hierarchy. |
| 58 views::View* contents_view_ = nullptr; | 60 views::View* contents_view_ = nullptr; |
| 59 std::unique_ptr<CustomNotificationContentViewDelegate> | 61 std::unique_ptr<CustomNotificationContentViewDelegate> |
| 60 contents_view_delegate_; | 62 contents_view_delegate_; |
| 61 | 63 |
| 62 std::unique_ptr<views::Painter> focus_painter_; | 64 std::unique_ptr<views::Painter> focus_painter_; |
| 63 | 65 |
| 64 DISALLOW_COPY_AND_ASSIGN(CustomNotificationView); | 66 DISALLOW_COPY_AND_ASSIGN(CustomNotificationView); |
| 65 }; | 67 }; |
| 66 | 68 |
| 67 } // namespace message_center | 69 } // namespace message_center |
| 68 | 70 |
| 69 #endif // UI_MESSAGE_CENTER_VIEWS_CUSTOM_NOTIFICATION_VIEW_H_ | 71 #endif // UI_MESSAGE_CENTER_VIEWS_CUSTOM_NOTIFICATION_VIEW_H_ |
| OLD | NEW |