| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_MESSAGE_VIEW_H_ | 5 #ifndef UI_MESSAGE_CENTER_VIEWS_MESSAGE_VIEW_H_ |
| 6 #define UI_MESSAGE_CENTER_VIEWS_MESSAGE_VIEW_H_ | 6 #define UI_MESSAGE_CENTER_VIEWS_MESSAGE_VIEW_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 | 93 |
| 94 protected: | 94 protected: |
| 95 // Overridden from views::SlideOutView: | 95 // Overridden from views::SlideOutView: |
| 96 void OnSlideOut() override; | 96 void OnSlideOut() override; |
| 97 | 97 |
| 98 // Creates and add close button to view hierarchy when necessary. Derived | 98 // Creates and add close button to view hierarchy when necessary. Derived |
| 99 // classes should call this after its view hierarchy is populated to ensure | 99 // classes should call this after its view hierarchy is populated to ensure |
| 100 // it is on top of other views. | 100 // it is on top of other views. |
| 101 void CreateOrUpdateCloseButtonView(const Notification& notification); | 101 void CreateOrUpdateCloseButtonView(const Notification& notification); |
| 102 | 102 |
| 103 // Changes the background color being used by |background_view_| and schedules |
| 104 // a paint. |
| 105 virtual void SetDrawBackgroundAsActive(bool active); |
| 106 |
| 107 views::View* background_view() { return background_view_; } |
| 103 views::ImageView* small_image() { return small_image_view_.get(); } | 108 views::ImageView* small_image() { return small_image_view_.get(); } |
| 104 views::ImageButton* close_button() { return close_button_.get(); } | 109 views::ImageButton* close_button() { return close_button_.get(); } |
| 105 views::ScrollView* scroller() { return scroller_; } | 110 views::ScrollView* scroller() { return scroller_; } |
| 106 MessageCenterController* controller() { return controller_; } | 111 MessageCenterController* controller() { return controller_; } |
| 107 | 112 |
| 108 private: | 113 private: |
| 109 // Changes the background color being used by |background_view_| and schedules | |
| 110 // a paint. | |
| 111 void SetDrawBackgroundAsActive(bool active); | |
| 112 | |
| 113 MessageCenterController* controller_; // Weak, lives longer then views. | 114 MessageCenterController* controller_; // Weak, lives longer then views. |
| 114 std::string notification_id_; | 115 std::string notification_id_; |
| 115 NotifierId notifier_id_; | 116 NotifierId notifier_id_; |
| 116 views::View* background_view_ = nullptr; // Owned by views hierarchy. | 117 views::View* background_view_ = nullptr; // Owned by views hierarchy. |
| 117 std::unique_ptr<views::ImageView> small_image_view_; | 118 std::unique_ptr<views::ImageView> small_image_view_; |
| 118 std::unique_ptr<views::ImageButton> close_button_; | 119 std::unique_ptr<views::ImageButton> close_button_; |
| 119 views::ScrollView* scroller_ = nullptr; | 120 views::ScrollView* scroller_ = nullptr; |
| 120 | 121 |
| 121 base::string16 accessible_name_; | 122 base::string16 accessible_name_; |
| 122 | 123 |
| 123 base::string16 display_source_; | 124 base::string16 display_source_; |
| 124 | 125 |
| 125 std::unique_ptr<views::Painter> focus_painter_; | 126 std::unique_ptr<views::Painter> focus_painter_; |
| 126 | 127 |
| 127 DISALLOW_COPY_AND_ASSIGN(MessageView); | 128 DISALLOW_COPY_AND_ASSIGN(MessageView); |
| 128 }; | 129 }; |
| 129 | 130 |
| 130 } // namespace message_center | 131 } // namespace message_center |
| 131 | 132 |
| 132 #endif // UI_MESSAGE_CENTER_VIEWS_MESSAGE_VIEW_H_ | 133 #endif // UI_MESSAGE_CENTER_VIEWS_MESSAGE_VIEW_H_ |
| OLD | NEW |