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 | 7 |
8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
9 #include "ash/wm/window_settings.h" | 9 #include "ash/wm/window_settings.h" |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/compiler_specific.h" // OVERRIDE | 11 #include "base/compiler_specific.h" // OVERRIDE |
12 #include "base/gtest_prod_util.h" | 12 #include "base/gtest_prod_util.h" |
13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
14 #include "ui/aura/window_observer.h" | 14 #include "ui/aura/window_observer.h" |
15 #include "ui/base/animation/animation_delegate.h" | 15 #include "ui/gfx/animation/animation_delegate.h" |
16 #include "ui/gfx/rect.h" | 16 #include "ui/gfx/rect.h" |
17 | 17 |
18 namespace aura { | 18 namespace aura { |
19 class RootWindow; | 19 class RootWindow; |
20 class Window; | 20 class Window; |
21 } | 21 } |
22 namespace gfx { | 22 namespace gfx { |
23 class Canvas; | 23 class Canvas; |
24 class Font; | 24 class Font; |
25 class ImageSkia; | 25 class ImageSkia; |
26 class Point; | 26 class Point; |
27 class Size; | 27 class Size; |
28 } | |
29 namespace ui { | |
30 class SlideAnimation; | 28 class SlideAnimation; |
31 } | 29 } |
32 namespace views { | 30 namespace views { |
33 class NonClientFrameView; | 31 class NonClientFrameView; |
34 class View; | 32 class View; |
35 class Widget; | 33 class Widget; |
36 } | 34 } |
37 | 35 |
38 namespace ash { | 36 namespace ash { |
39 class FrameCaptionButtonContainerView; | 37 class FrameCaptionButtonContainerView; |
40 | 38 |
41 // Helper class for painting window frames. Exists to share code between | 39 // Helper class for painting window frames. Exists to share code between |
42 // various implementations of views::NonClientFrameView. Canonical source of | 40 // various implementations of views::NonClientFrameView. Canonical source of |
43 // layout constants for Ash window frames. | 41 // layout constants for Ash window frames. |
44 class ASH_EXPORT FramePainter : public aura::WindowObserver, | 42 class ASH_EXPORT FramePainter : public aura::WindowObserver, |
45 public ui::AnimationDelegate, | 43 public gfx::AnimationDelegate, |
46 public wm::WindowSettings::Observer { | 44 public wm::WindowSettings::Observer { |
47 public: | 45 public: |
48 // Opacity values for the window header in various states, from 0 to 255. | 46 // Opacity values for the window header in various states, from 0 to 255. |
49 static int kActiveWindowOpacity; | 47 static int kActiveWindowOpacity; |
50 static int kInactiveWindowOpacity; | 48 static int kInactiveWindowOpacity; |
51 static int kSoloWindowOpacity; | 49 static int kSoloWindowOpacity; |
52 | 50 |
53 enum HeaderMode { | 51 enum HeaderMode { |
54 ACTIVE, | 52 ACTIVE, |
55 INACTIVE | 53 INACTIVE |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 virtual void OnWindowBoundsChanged(aura::Window* window, | 142 virtual void OnWindowBoundsChanged(aura::Window* window, |
145 const gfx::Rect& old_bounds, | 143 const gfx::Rect& old_bounds, |
146 const gfx::Rect& new_bounds) OVERRIDE; | 144 const gfx::Rect& new_bounds) OVERRIDE; |
147 virtual void OnWindowAddedToRootWindow(aura::Window* window) OVERRIDE; | 145 virtual void OnWindowAddedToRootWindow(aura::Window* window) OVERRIDE; |
148 virtual void OnWindowRemovingFromRootWindow(aura::Window* window) OVERRIDE; | 146 virtual void OnWindowRemovingFromRootWindow(aura::Window* window) OVERRIDE; |
149 | 147 |
150 // ash::WindowSettings::Observer overrides: | 148 // ash::WindowSettings::Observer overrides: |
151 virtual void OnTrackedByWorkspaceChanged(aura::Window* window, | 149 virtual void OnTrackedByWorkspaceChanged(aura::Window* window, |
152 bool old) OVERRIDE; | 150 bool old) OVERRIDE; |
153 | 151 |
154 // Overridden from ui::AnimationDelegate | 152 // Overridden from gfx::AnimationDelegate |
155 virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE; | 153 virtual void AnimationProgressed(const gfx::Animation* animation) OVERRIDE; |
156 | 154 |
157 private: | 155 private: |
158 FRIEND_TEST_ALL_PREFIXES(FramePainterTest, CreateAndDeleteSingleWindow); | 156 FRIEND_TEST_ALL_PREFIXES(FramePainterTest, CreateAndDeleteSingleWindow); |
159 FRIEND_TEST_ALL_PREFIXES(FramePainterTest, UseSoloWindowHeader); | 157 FRIEND_TEST_ALL_PREFIXES(FramePainterTest, UseSoloWindowHeader); |
160 FRIEND_TEST_ALL_PREFIXES(FramePainterTest, UseSoloWindowHeaderWithApp); | 158 FRIEND_TEST_ALL_PREFIXES(FramePainterTest, UseSoloWindowHeaderWithApp); |
161 FRIEND_TEST_ALL_PREFIXES(FramePainterTest, UseSoloWindowHeaderWithPanel); | 159 FRIEND_TEST_ALL_PREFIXES(FramePainterTest, UseSoloWindowHeaderWithPanel); |
162 FRIEND_TEST_ALL_PREFIXES(FramePainterTest, UseSoloWindowHeaderModal); | 160 FRIEND_TEST_ALL_PREFIXES(FramePainterTest, UseSoloWindowHeaderModal); |
163 FRIEND_TEST_ALL_PREFIXES(FramePainterTest, UseSoloWindowHeaderConstrained); | 161 FRIEND_TEST_ALL_PREFIXES(FramePainterTest, UseSoloWindowHeaderConstrained); |
164 FRIEND_TEST_ALL_PREFIXES(FramePainterTest, UseSoloWindowHeaderNotDrawn); | 162 FRIEND_TEST_ALL_PREFIXES(FramePainterTest, UseSoloWindowHeaderNotDrawn); |
165 FRIEND_TEST_ALL_PREFIXES(FramePainterTest, UseSoloWindowHeaderMultiDisplay); | 163 FRIEND_TEST_ALL_PREFIXES(FramePainterTest, UseSoloWindowHeaderMultiDisplay); |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 int previous_theme_frame_id_; | 229 int previous_theme_frame_id_; |
232 int previous_theme_frame_overlay_id_; | 230 int previous_theme_frame_overlay_id_; |
233 int previous_opacity_; | 231 int previous_opacity_; |
234 | 232 |
235 // Image ids and opacity we are crossfading from. | 233 // Image ids and opacity we are crossfading from. |
236 int crossfade_theme_frame_id_; | 234 int crossfade_theme_frame_id_; |
237 int crossfade_theme_frame_overlay_id_; | 235 int crossfade_theme_frame_overlay_id_; |
238 int crossfade_opacity_; | 236 int crossfade_opacity_; |
239 | 237 |
240 gfx::Rect header_frame_bounds_; | 238 gfx::Rect header_frame_bounds_; |
241 scoped_ptr<ui::SlideAnimation> crossfade_animation_; | 239 scoped_ptr<gfx::SlideAnimation> crossfade_animation_; |
242 | 240 |
243 DISALLOW_COPY_AND_ASSIGN(FramePainter); | 241 DISALLOW_COPY_AND_ASSIGN(FramePainter); |
244 }; | 242 }; |
245 | 243 |
246 } // namespace ash | 244 } // namespace ash |
247 | 245 |
248 #endif // ASH_WM_FRAME_PAINTER_H_ | 246 #endif // ASH_WM_FRAME_PAINTER_H_ |
OLD | NEW |