OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "ash/wm/maximize_mode/maximize_mode_window_state.h" | 5 #include "ash/wm/maximize_mode/maximize_mode_window_state.h" |
6 | 6 |
7 #include "ash/display/display_controller.h" | 7 #include "ash/display/display_controller.h" |
8 #include "ash/screen_util.h" | 8 #include "ash/screen_util.h" |
9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
10 #include "ash/shell_window_ids.h" | 10 #include "ash/shell_window_ids.h" |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 case wm::WM_EVENT_ADDED_TO_WORKSPACE: | 169 case wm::WM_EVENT_ADDED_TO_WORKSPACE: |
170 if (current_state_type_ != wm::WINDOW_STATE_TYPE_MAXIMIZED && | 170 if (current_state_type_ != wm::WINDOW_STATE_TYPE_MAXIMIZED && |
171 current_state_type_ != wm::WINDOW_STATE_TYPE_FULLSCREEN && | 171 current_state_type_ != wm::WINDOW_STATE_TYPE_FULLSCREEN && |
172 current_state_type_ != wm::WINDOW_STATE_TYPE_MINIMIZED) { | 172 current_state_type_ != wm::WINDOW_STATE_TYPE_MINIMIZED) { |
173 wm::WindowStateType new_state = | 173 wm::WindowStateType new_state = |
174 GetMaximizedOrCenteredWindowType(window_state); | 174 GetMaximizedOrCenteredWindowType(window_state); |
175 UpdateWindow(window_state, new_state, true); | 175 UpdateWindow(window_state, new_state, true); |
176 } | 176 } |
177 break; | 177 break; |
178 case wm::WM_EVENT_WORKAREA_BOUNDS_CHANGED: | 178 case wm::WM_EVENT_WORKAREA_BOUNDS_CHANGED: |
179 case wm::WM_EVENT_DISPLAY_BOUNDS_CHANGED: | |
180 if (current_state_type_ != wm::WINDOW_STATE_TYPE_MINIMIZED) | 179 if (current_state_type_ != wm::WINDOW_STATE_TYPE_MINIMIZED) |
181 UpdateBounds(window_state, true); | 180 UpdateBounds(window_state, true); |
182 break; | 181 break; |
| 182 case wm::WM_EVENT_DISPLAY_BOUNDS_CHANGED: |
| 183 // Don't animate on a screen rotation - just snap to new size. |
| 184 if (current_state_type_ != wm::WINDOW_STATE_TYPE_MINIMIZED) |
| 185 UpdateBounds(window_state, false); |
| 186 break; |
183 } | 187 } |
184 } | 188 } |
185 | 189 |
186 wm::WindowStateType MaximizeModeWindowState::GetType() const { | 190 wm::WindowStateType MaximizeModeWindowState::GetType() const { |
187 return current_state_type_; | 191 return current_state_type_; |
188 } | 192 } |
189 | 193 |
190 void MaximizeModeWindowState::AttachState( | 194 void MaximizeModeWindowState::AttachState( |
191 wm::WindowState* window_state, | 195 wm::WindowState* window_state, |
192 wm::WindowState::State* previous_state) { | 196 wm::WindowState::State* previous_state) { |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 // avoid flashing. | 294 // avoid flashing. |
291 if (window_state->IsMaximized()) | 295 if (window_state->IsMaximized()) |
292 window_state->SetBoundsDirectCrossFade(bounds_in_parent); | 296 window_state->SetBoundsDirectCrossFade(bounds_in_parent); |
293 else | 297 else |
294 window_state->SetBoundsDirectAnimated(bounds_in_parent); | 298 window_state->SetBoundsDirectAnimated(bounds_in_parent); |
295 } | 299 } |
296 } | 300 } |
297 } | 301 } |
298 | 302 |
299 } // namespace ash | 303 } // namespace ash |
OLD | NEW |