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