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 <utility> | 7 #include <utility> |
8 | 8 |
9 #include "ash/public/cpp/shell_window_ids.h" | 9 #include "ash/public/cpp/shell_window_ids.h" |
10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 if (defer_bounds_updates_ == defer_bounds_updates) | 114 if (defer_bounds_updates_ == defer_bounds_updates) |
115 return; | 115 return; |
116 | 116 |
117 defer_bounds_updates_ = defer_bounds_updates; | 117 defer_bounds_updates_ = defer_bounds_updates; |
118 if (!defer_bounds_updates_) | 118 if (!defer_bounds_updates_) |
119 UpdateBounds(window_->GetWindowState(), true); | 119 UpdateBounds(window_->GetWindowState(), true); |
120 } | 120 } |
121 | 121 |
122 void MaximizeModeWindowState::OnWMEvent(wm::WindowState* window_state, | 122 void MaximizeModeWindowState::OnWMEvent(wm::WindowState* window_state, |
123 const wm::WMEvent* event) { | 123 const wm::WMEvent* event) { |
| 124 // Ignore events that are sent during the exit transition. |
| 125 if (ignore_wm_events_) { |
| 126 return; |
| 127 } |
| 128 |
124 switch (event->type()) { | 129 switch (event->type()) { |
125 case wm::WM_EVENT_TOGGLE_FULLSCREEN: | 130 case wm::WM_EVENT_TOGGLE_FULLSCREEN: |
126 ToggleFullScreen(window_state, window_state->delegate()); | 131 ToggleFullScreen(window_state, window_state->delegate()); |
127 break; | 132 break; |
128 case wm::WM_EVENT_FULLSCREEN: | 133 case wm::WM_EVENT_FULLSCREEN: |
129 UpdateWindow(window_state, wm::WINDOW_STATE_TYPE_FULLSCREEN, true); | 134 UpdateWindow(window_state, wm::WINDOW_STATE_TYPE_FULLSCREEN, true); |
130 break; | 135 break; |
131 case wm::WM_EVENT_PIN: | 136 case wm::WM_EVENT_PIN: |
132 if (!Shell::Get()->screen_pinning_controller()->IsPinned()) | 137 if (!Shell::Get()->screen_pinning_controller()->IsPinned()) |
133 UpdateWindow(window_state, wm::WINDOW_STATE_TYPE_PINNED, true); | 138 UpdateWindow(window_state, wm::WINDOW_STATE_TYPE_PINNED, true); |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 // avoid flashing. | 323 // avoid flashing. |
319 if (window_state->IsMaximized()) | 324 if (window_state->IsMaximized()) |
320 window_state->SetBoundsDirectCrossFade(bounds_in_parent); | 325 window_state->SetBoundsDirectCrossFade(bounds_in_parent); |
321 else | 326 else |
322 window_state->SetBoundsDirectAnimated(bounds_in_parent); | 327 window_state->SetBoundsDirectAnimated(bounds_in_parent); |
323 } | 328 } |
324 } | 329 } |
325 } | 330 } |
326 | 331 |
327 } // namespace ash | 332 } // namespace ash |
OLD | NEW |