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::ImplicitAnimationObserver { | 28 public ui::LayerAnimationObserver { |
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::OnImplicitAnimationsCompleted: | 51 // ui::LayerAnimationObserver: |
52 virtual void OnImplicitAnimationsCompleted() OVERRIDE; | 52 virtual void OnLayerAnimationEnded( |
| 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; |
53 | 58 |
54 private: | 59 private: |
55 FRIEND_TEST_ALL_PREFIXES(CompactLayoutManagerTransitionTest, | 60 FRIEND_TEST_ALL_PREFIXES(CompactLayoutManagerTransitionTest, |
56 TransitionTest); | 61 TransitionTest); |
57 | 62 |
58 // Hides the status area if we are managing it and full screen windows are | 63 // Hides the status area if we are managing it and full screen windows are |
59 // visible. | 64 // visible. |
60 void UpdateStatusAreaVisibility(); | 65 void UpdateStatusAreaVisibility(); |
61 | 66 |
62 // Start a slide in / out animation sequence for the layer. | 67 // Start a slide in / out animation sequence for the layer. |
(...skipping 19 matching lines...) Expand all Loading... |
82 // The browser window currently in the viewport. | 87 // The browser window currently in the viewport. |
83 aura::Window* current_window_; | 88 aura::Window* current_window_; |
84 | 89 |
85 DISALLOW_COPY_AND_ASSIGN(CompactLayoutManager); | 90 DISALLOW_COPY_AND_ASSIGN(CompactLayoutManager); |
86 }; | 91 }; |
87 | 92 |
88 } // namespace ash | 93 } // namespace ash |
89 } // namespace internal | 94 } // namespace internal |
90 | 95 |
91 #endif // ASH_WM_COMPACT_LAYOUT_MANAGER_H_ | 96 #endif // ASH_WM_COMPACT_LAYOUT_MANAGER_H_ |
OLD | NEW |