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_WM_FRAME_PAINTER_H_ | 5 #ifndef ASH_WM_FRAME_PAINTER_H_ |
6 #define ASH_WM_FRAME_PAINTER_H_ | 6 #define ASH_WM_FRAME_PAINTER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <set> | 9 #include <set> |
10 | 10 |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 const gfx::Font& title_font); | 103 const gfx::Font& title_font); |
104 | 104 |
105 // Performs layout for the header based on whether we want the shorter | 105 // Performs layout for the header based on whether we want the shorter |
106 // |maximized_layout| appearance. | 106 // |maximized_layout| appearance. |
107 void LayoutHeader(views::NonClientFrameView* view, bool maximized_layout); | 107 void LayoutHeader(views::NonClientFrameView* view, bool maximized_layout); |
108 | 108 |
109 // aura::WindowObserver overrides: | 109 // aura::WindowObserver overrides: |
110 virtual void OnWindowPropertyChanged(aura::Window* window, | 110 virtual void OnWindowPropertyChanged(aura::Window* window, |
111 const void* key, | 111 const void* key, |
112 intptr_t old) OVERRIDE; | 112 intptr_t old) OVERRIDE; |
| 113 virtual void OnWindowVisibilityChanged(aura::Window* window, |
| 114 bool visible) OVERRIDE; |
113 virtual void OnWindowDestroying(aura::Window* window) OVERRIDE; | 115 virtual void OnWindowDestroying(aura::Window* window) OVERRIDE; |
114 | 116 |
115 // Overridden from ui::AnimationDelegate | 117 // Overridden from ui::AnimationDelegate |
116 virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE; | 118 virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE; |
117 | 119 |
118 private: | 120 private: |
119 FRIEND_TEST_ALL_PREFIXES(FramePainterTest, Basics); | 121 FRIEND_TEST_ALL_PREFIXES(FramePainterTest, Basics); |
120 FRIEND_TEST_ALL_PREFIXES(FramePainterTest, UseSoloWindowHeader); | 122 FRIEND_TEST_ALL_PREFIXES(FramePainterTest, UseSoloWindowHeader); |
121 | 123 |
122 // Sets the images for a button base on IDs from the |frame_| theme provider. | 124 // Sets the images for a button base on IDs from the |frame_| theme provider. |
123 void SetButtonImages(views::ImageButton* button, | 125 void SetButtonImages(views::ImageButton* button, |
124 int normal_bitmap_id, | 126 int normal_bitmap_id, |
125 int hot_bitmap_id, | 127 int hot_bitmap_id, |
126 int pushed_bitmap_id); | 128 int pushed_bitmap_id); |
127 | 129 |
128 // Returns the offset between window left edge and title string. | 130 // Returns the offset between window left edge and title string. |
129 int GetTitleOffsetX() const; | 131 int GetTitleOffsetX() const; |
130 | 132 |
131 // Returns true if there is exactly one visible, normal-type window using | 133 // Returns true if there is exactly one visible, normal-type window using |
132 // a header painted by this class, in which case we should paint a transparent | 134 // a header painted by this class, in which case we should paint a transparent |
133 // window header. | 135 // window header. |
134 static bool UseSoloWindowHeader(); | 136 static bool UseSoloWindowHeader(); |
135 | 137 |
| 138 // Schedules a paint for the window header of the solo window. Invoke this |
| 139 // when another window is hidden or destroyed to force the transparency of |
| 140 // the now-solo window to update. |
| 141 static void SchedulePaintForSoloWindow(); |
| 142 |
136 static std::set<FramePainter*>* instances_; | 143 static std::set<FramePainter*>* instances_; |
137 | 144 |
138 // Not owned | 145 // Not owned |
139 views::Widget* frame_; | 146 views::Widget* frame_; |
140 views::View* window_icon_; // May be NULL. | 147 views::View* window_icon_; // May be NULL. |
141 views::ImageButton* size_button_; | 148 views::ImageButton* size_button_; |
142 views::ImageButton* close_button_; | 149 views::ImageButton* close_button_; |
143 aura::Window* window_; | 150 aura::Window* window_; |
144 | 151 |
145 // Window frame header/caption parts. | 152 // Window frame header/caption parts. |
(...skipping 16 matching lines...) Expand all Loading... |
162 scoped_ptr<ui::SlideAnimation> crossfade_animation_; | 169 scoped_ptr<ui::SlideAnimation> crossfade_animation_; |
163 | 170 |
164 SizeButtonBehavior size_button_behavior_; | 171 SizeButtonBehavior size_button_behavior_; |
165 | 172 |
166 DISALLOW_COPY_AND_ASSIGN(FramePainter); | 173 DISALLOW_COPY_AND_ASSIGN(FramePainter); |
167 }; | 174 }; |
168 | 175 |
169 } // namespace ash | 176 } // namespace ash |
170 | 177 |
171 #endif // ASH_WM_FRAME_PAINTER_H_ | 178 #endif // ASH_WM_FRAME_PAINTER_H_ |
OLD | NEW |