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_COMPACT_LAYOUT_MANAGER_H_ | 5 #ifndef ASH_WM_COMPACT_LAYOUT_MANAGER_H_ |
6 #define ASH_WM_COMPACT_LAYOUT_MANAGER_H_ | 6 #define ASH_WM_COMPACT_LAYOUT_MANAGER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "ash/ash_export.h" | 9 #include "ash/ash_export.h" |
10 #include "ash/wm/base_layout_manager.h" | 10 #include "ash/wm/base_layout_manager.h" |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
13 #include "base/gtest_prod_util.h" | 13 #include "base/gtest_prod_util.h" |
14 #include "ui/gfx/compositor/layer_animation_observer.h" | 14 #include "ui/gfx/compositor/layer_animation_observer.h" |
15 | 15 |
16 namespace views { | 16 namespace views { |
17 class Widget; | 17 class Widget; |
18 } | 18 } |
19 | 19 |
20 namespace ash { | 20 namespace ash { |
21 namespace internal { | 21 namespace internal { |
22 | 22 |
23 // CompactLayoutManager is the LayoutManager used in compact window mode, | 23 // CompactLayoutManager is the LayoutManager used in compact window mode, |
24 // which emulates the traditional Chrome OS window manager. Windows are always | 24 // which emulates the traditional Chrome OS window manager. Windows are always |
25 // maximized, fill the screen, and only one tabbed browser window is visible at | 25 // maximized, fill the screen, and only one tabbed browser window is visible at |
26 // a time. The status area appears in the top-right corner of the screen. | 26 // a time. The status area appears in the top-right corner of the screen. |
27 class ASH_EXPORT CompactLayoutManager : public BaseLayoutManager, | 27 class ASH_EXPORT CompactLayoutManager : public BaseLayoutManager, |
28 public ui::LayerAnimationObserver { | 28 public ui::ImplicitAnimationObserver { |
29 public: | 29 public: |
30 CompactLayoutManager(); | 30 CompactLayoutManager(); |
31 virtual ~CompactLayoutManager(); | 31 virtual ~CompactLayoutManager(); |
32 | 32 |
33 void set_status_area_widget(views::Widget* widget) { | 33 void set_status_area_widget(views::Widget* widget) { |
34 status_area_widget_ = widget; | 34 status_area_widget_ = widget; |
35 } | 35 } |
36 | 36 |
37 // LayoutManager overrides: | 37 // LayoutManager overrides: |
38 virtual void OnWindowAddedToLayout(aura::Window* child) OVERRIDE; | 38 virtual void OnWindowAddedToLayout(aura::Window* child) OVERRIDE; |
39 virtual void OnWillRemoveWindowFromLayout(aura::Window* child) OVERRIDE; | 39 virtual void OnWillRemoveWindowFromLayout(aura::Window* child) OVERRIDE; |
40 virtual void OnChildWindowVisibilityChanged(aura::Window* child, | 40 virtual void OnChildWindowVisibilityChanged(aura::Window* child, |
41 bool visibile) OVERRIDE; | 41 bool visibile) OVERRIDE; |
42 virtual void SetChildBounds(aura::Window* child, | 42 virtual void SetChildBounds(aura::Window* child, |
43 const gfx::Rect& requested_bounds) OVERRIDE; | 43 const gfx::Rect& requested_bounds) OVERRIDE; |
44 | 44 |
45 // WindowObserver overrides: | 45 // WindowObserver overrides: |
46 virtual void OnWindowPropertyChanged(aura::Window* window, | 46 virtual void OnWindowPropertyChanged(aura::Window* window, |
47 const char* name, | 47 const char* name, |
48 void* old) OVERRIDE; | 48 void* old) OVERRIDE; |
49 virtual void OnWindowStackingChanged(aura::Window* window) OVERRIDE; | 49 virtual void OnWindowStackingChanged(aura::Window* window) OVERRIDE; |
50 | 50 |
51 // ui::LayerAnimationObserver: | 51 // ui::OnImplicitAnimationsCompleted: |
52 virtual void OnLayerAnimationEnded( | 52 virtual void OnImplicitAnimationsCompleted() OVERRIDE; |
53 const ui::LayerAnimationSequence* animation) OVERRIDE; | |
54 virtual void OnLayerAnimationScheduled( | |
55 const ui::LayerAnimationSequence* animation) OVERRIDE; | |
56 virtual void OnLayerAnimationAborted( | |
57 const ui::LayerAnimationSequence* animation) OVERRIDE; | |
58 | 53 |
59 private: | 54 private: |
60 FRIEND_TEST_ALL_PREFIXES(CompactLayoutManagerTransitionTest, | 55 FRIEND_TEST_ALL_PREFIXES(CompactLayoutManagerTransitionTest, |
61 TransitionTest); | 56 TransitionTest); |
62 | 57 |
63 // Hides the status area if we are managing it and full screen windows are | 58 // Hides the status area if we are managing it and full screen windows are |
64 // visible. | 59 // visible. |
65 void UpdateStatusAreaVisibility(); | 60 void UpdateStatusAreaVisibility(); |
66 | 61 |
67 // Start a slide in / out animation sequence for the layer. | 62 // Start a slide in / out animation sequence for the layer. |
(...skipping 19 matching lines...) Expand all Loading... |
87 // The browser window currently in the viewport. | 82 // The browser window currently in the viewport. |
88 aura::Window* current_window_; | 83 aura::Window* current_window_; |
89 | 84 |
90 DISALLOW_COPY_AND_ASSIGN(CompactLayoutManager); | 85 DISALLOW_COPY_AND_ASSIGN(CompactLayoutManager); |
91 }; | 86 }; |
92 | 87 |
93 } // namespace ash | 88 } // namespace ash |
94 } // namespace internal | 89 } // namespace internal |
95 | 90 |
96 #endif // ASH_WM_COMPACT_LAYOUT_MANAGER_H_ | 91 #endif // ASH_WM_COMPACT_LAYOUT_MANAGER_H_ |
OLD | NEW |