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 ASH_SYSTEM_TRAY_TRAY_BACKGROUND_VIEW_H_ | 5 #ifndef ASH_SYSTEM_TRAY_TRAY_BACKGROUND_VIEW_H_ |
6 #define ASH_SYSTEM_TRAY_TRAY_BACKGROUND_VIEW_H_ | 6 #define ASH_SYSTEM_TRAY_TRAY_BACKGROUND_VIEW_H_ |
7 | 7 |
8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
9 #include "ash/launcher/background_animator.h" | 9 #include "ash/launcher/background_animator.h" |
10 #include "ash/system/tray/tray_views.h" | 10 #include "ash/system/tray/tray_views.h" |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 | 74 |
75 // Sets |contents| as a child and sets its background to |background_|. | 75 // Sets |contents| as a child and sets its background to |background_|. |
76 void SetContents(views::View* contents); | 76 void SetContents(views::View* contents); |
77 | 77 |
78 // Sets whether the tray paints a background. Default is true, but is set to | 78 // Sets whether the tray paints a background. Default is true, but is set to |
79 // false if a window overlaps the shelf. | 79 // false if a window overlaps the shelf. |
80 void SetPaintsBackground( | 80 void SetPaintsBackground( |
81 bool value, | 81 bool value, |
82 internal::BackgroundAnimator::ChangeType change_type); | 82 internal::BackgroundAnimator::ChangeType change_type); |
83 | 83 |
| 84 // Called after all status area trays have been created. Sets the border |
| 85 // based on the position of the view. |
| 86 void SetBorder(); |
| 87 |
84 StatusAreaWidget* status_area_widget() { | 88 StatusAreaWidget* status_area_widget() { |
85 return status_area_widget_; | 89 return status_area_widget_; |
86 } | 90 } |
87 TrayContainer* tray_container() const { return tray_container_; } | 91 TrayContainer* tray_container() const { return tray_container_; } |
88 ShelfAlignment shelf_alignment() const { return shelf_alignment_; } | 92 ShelfAlignment shelf_alignment() const { return shelf_alignment_; } |
89 | 93 |
90 private: | 94 private: |
91 void SetBorder(); | |
92 | |
93 // Unowned pointer to parent widget. | 95 // Unowned pointer to parent widget. |
94 StatusAreaWidget* status_area_widget_; | 96 StatusAreaWidget* status_area_widget_; |
95 | 97 |
96 // Convenience pointer to the contents view. | 98 // Convenience pointer to the contents view. |
97 TrayContainer* tray_container_; | 99 TrayContainer* tray_container_; |
98 | 100 |
99 // Shelf alignment. | 101 // Shelf alignment. |
100 ShelfAlignment shelf_alignment_; | 102 ShelfAlignment shelf_alignment_; |
101 | 103 |
102 // Owned by the view passed to SetContents(). | 104 // Owned by the view passed to SetContents(). |
103 internal::TrayBackground* background_; | 105 internal::TrayBackground* background_; |
104 | 106 |
105 internal::BackgroundAnimator hide_background_animator_; | 107 internal::BackgroundAnimator hide_background_animator_; |
106 internal::BackgroundAnimator hover_background_animator_; | 108 internal::BackgroundAnimator hover_background_animator_; |
107 | 109 |
108 DISALLOW_COPY_AND_ASSIGN(TrayBackgroundView); | 110 DISALLOW_COPY_AND_ASSIGN(TrayBackgroundView); |
109 }; | 111 }; |
110 | 112 |
111 } // namespace internal | 113 } // namespace internal |
112 } // namespace ash | 114 } // namespace ash |
113 | 115 |
114 #endif // ASH_SYSTEM_TRAY_TRAY_BACKGROUND_VIEW_H_ | 116 #endif // ASH_SYSTEM_TRAY_TRAY_BACKGROUND_VIEW_H_ |
OLD | NEW |