| 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 | 42 |
| 43 // views::SlideOutController::Delegate: |
| 44 void OnSlideChanged() override; |
| 45 |
| 43 // Overridden from views::View: | 46 // Overridden from views::View: |
| 44 const char* GetClassName() const override; | 47 const char* GetClassName() const override; |
| 45 gfx::Size GetPreferredSize() const override; | 48 gfx::Size GetPreferredSize() const override; |
| 46 void Layout() override; | 49 void Layout() override; |
| 47 bool HasFocus() const override; | 50 bool HasFocus() const override; |
| 48 void RequestFocus() override; | 51 void RequestFocus() override; |
| 49 void OnPaint(gfx::Canvas* canvas) override; | 52 void OnPaint(gfx::Canvas* canvas) override; |
| 50 bool OnKeyPressed(const ui::KeyEvent& event) override; | 53 bool OnKeyPressed(const ui::KeyEvent& event) override; |
| 51 void ChildPreferredSizeChanged(View* child) override; | 54 void ChildPreferredSizeChanged(View* child) override; |
| 52 bool HandleAccessibleAction(const ui::AXActionData& action) override; | 55 bool HandleAccessibleAction(const ui::AXActionData& action) override; |
| 53 | 56 |
| 54 private: | 57 private: |
| 55 friend class CustomNotificationViewTest; | 58 friend class CustomNotificationViewTest; |
| 56 | 59 |
| 57 // The view for the custom content. Owned by view hierarchy. | 60 // The view for the custom content. Owned by view hierarchy. |
| 58 views::View* contents_view_ = nullptr; | 61 views::View* contents_view_ = nullptr; |
| 59 std::unique_ptr<CustomNotificationContentViewDelegate> | 62 std::unique_ptr<CustomNotificationContentViewDelegate> |
| 60 contents_view_delegate_; | 63 contents_view_delegate_; |
| 61 | 64 |
| 62 std::unique_ptr<views::Painter> focus_painter_; | 65 std::unique_ptr<views::Painter> focus_painter_; |
| 63 | 66 |
| 64 DISALLOW_COPY_AND_ASSIGN(CustomNotificationView); | 67 DISALLOW_COPY_AND_ASSIGN(CustomNotificationView); |
| 65 }; | 68 }; |
| 66 | 69 |
| 67 } // namespace message_center | 70 } // namespace message_center |
| 68 | 71 |
| 69 #endif // UI_MESSAGE_CENTER_VIEWS_CUSTOM_NOTIFICATION_VIEW_H_ | 72 #endif // UI_MESSAGE_CENTER_VIEWS_CUSTOM_NOTIFICATION_VIEW_H_ |
| OLD | NEW |