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_BASE_LAYOUT_MANAGER_H_ | 5 #ifndef ASH_WM_BASE_LAYOUT_MANAGER_H_ |
6 #define ASH_WM_BASE_LAYOUT_MANAGER_H_ | 6 #define ASH_WM_BASE_LAYOUT_MANAGER_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "ash/ash_export.h" | 10 #include "ash/ash_export.h" |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
70 virtual void OnWindowBoundsChanged(aura::Window* window, | 70 virtual void OnWindowBoundsChanged(aura::Window* window, |
71 const gfx::Rect& old_bounds, | 71 const gfx::Rect& old_bounds, |
72 const gfx::Rect& new_bounds) OVERRIDE; | 72 const gfx::Rect& new_bounds) OVERRIDE; |
73 | 73 |
74 // aura::client::ActivationChangeObserver overrides: | 74 // aura::client::ActivationChangeObserver overrides: |
75 virtual void OnWindowActivated(aura::Window* gained_active, | 75 virtual void OnWindowActivated(aura::Window* gained_active, |
76 aura::Window* lost_active) OVERRIDE; | 76 aura::Window* lost_active) OVERRIDE; |
77 | 77 |
78 protected: | 78 protected: |
79 enum AdjustWindowReason { | 79 enum AdjustWindowReason { |
80 ADJUST_WINDOW_SCREEN_SIZE_CHANGED, | 80 ADJUST_WINDOW_DISPLAY_SIZE_CHANGED, |
81 ADJUST_WINDOW_DISPLAY_INSETS_CHANGED, | 81 ADJUST_WINDOW_WORK_AREA_INSETS_CHANGED, |
82 ADJUST_WINDOW_WINDOW_ADDED | |
83 }; | 82 }; |
84 | 83 |
85 // Invoked from OnWindowPropertyChanged() if |kShowStateKey| changes. | 84 // Invoked from OnWindowPropertyChanged() if |kShowStateKey| changes. |
86 virtual void ShowStateChanged(aura::Window* window, | 85 virtual void ShowStateChanged(aura::Window* window, |
87 ui::WindowShowState last_show_state); | 86 ui::WindowShowState last_show_state); |
88 | 87 |
89 // Adjusts the window sizes when the screen changes its size or its | 88 // Adjusts the window's bounds when the display area changes for given |
90 // work area insets. If this is called for a screen size change (i.e. |reason| | 89 // window. This happens when the display size, work area insets or |
90 // the display on which the window exists has changd. | |
James Cook
2013/08/07 00:36:32
changd -> changed
oshima
2013/08/07 16:56:45
Done.
| |
91 // If this is called for a display size change (i.e. |reason| | |
91 // is ADJUST_WINDOW_SCREEN_SIZE_CHANGED), the non-maximized/non-fullscreen | 92 // is ADJUST_WINDOW_SCREEN_SIZE_CHANGED), the non-maximized/non-fullscreen |
James Cook
2013/08/07 00:36:32
ADJUST_WINDOW_DISPLAY_SIZE_CHANGED ?
oshima
2013/08/07 16:56:45
Done.
| |
92 // windows are readjusted to make sure the window is completely within the | 93 // windows are readjusted to make sure the window is completely within the |
93 // display region. Otherwise, it makes sure at least some parts of the window | 94 // display region. Otherwise, it makes sure at least some parts of the window |
94 // is on display. | 95 // is on display. |
95 virtual void AdjustWindowSizesForScreenChange(AdjustWindowReason reason); | 96 virtual void AdjustWindowsBoundsForWorkAreaChange(AdjustWindowReason reason); |
James Cook
2013/08/07 00:36:32
This might be clearer as AdjustAllWindowBoundsForW
oshima
2013/08/07 16:56:45
Agreed. Done.
| |
96 | 97 |
97 // Adjusts the sizes of the specific window in respond to a screen change or | 98 // Adjusts the sizes of the specific window in respond to a screen change or |
98 // display-area size change. | 99 // display-area size change. |
99 virtual void AdjustWindowSizeForScreenChange(aura::Window* window, | 100 virtual void AdjustWindowBoundsForWorkAreaChange(aura::Window* window, |
100 AdjustWindowReason reason); | 101 AdjustWindowReason reason); |
101 | 102 |
102 aura::RootWindow* root_window() { return root_window_; } | 103 aura::RootWindow* root_window() { return root_window_; } |
103 | 104 |
104 private: | 105 private: |
105 // Update window bounds based on a change in show state. | 106 // Update window bounds based on a change in show state. |
106 void UpdateBoundsFromShowState(aura::Window* window); | 107 void UpdateBoundsFromShowState(aura::Window* window); |
107 | 108 |
108 // Set of windows we're listening to. | 109 // Set of windows we're listening to. |
109 WindowSet windows_; | 110 WindowSet windows_; |
110 | 111 |
111 aura::RootWindow* root_window_; | 112 aura::RootWindow* root_window_; |
112 | 113 |
113 DISALLOW_COPY_AND_ASSIGN(BaseLayoutManager); | 114 DISALLOW_COPY_AND_ASSIGN(BaseLayoutManager); |
114 }; | 115 }; |
115 | 116 |
116 } // namespace internal | 117 } // namespace internal |
117 } // namespace ash | 118 } // namespace ash |
118 | 119 |
119 #endif // ASH_WM_BASE_LAYOUT_MANAGER_H_ | 120 #endif // ASH_WM_BASE_LAYOUT_MANAGER_H_ |
OLD | NEW |