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_controller.h" | 5 #include "ash/wm/maximize_mode/maximize_mode_controller.h" |
6 | 6 |
7 #include "ash/accelerators/accelerator_controller.h" | 7 #include "ash/accelerators/accelerator_controller.h" |
8 #include "ash/accelerators/accelerator_table.h" | 8 #include "ash/accelerators/accelerator_table.h" |
9 #include "ash/accelerometer/accelerometer_controller.h" | 9 #include "ash/accelerometer/accelerometer_controller.h" |
10 #include "ash/ash_switches.h" | 10 #include "ash/ash_switches.h" |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 } else if (!enable && maximize_mode_window_manager_.get()) { | 213 } else if (!enable && maximize_mode_window_manager_.get()) { |
214 maximize_mode_window_manager_.reset(); | 214 maximize_mode_window_manager_.reset(); |
215 Shell::GetInstance()->OnMaximizeModeEnded(); | 215 Shell::GetInstance()->OnMaximizeModeEnded(); |
216 } | 216 } |
217 } | 217 } |
218 | 218 |
219 bool MaximizeModeController::IsMaximizeModeWindowManagerEnabled() const { | 219 bool MaximizeModeController::IsMaximizeModeWindowManagerEnabled() const { |
220 return maximize_mode_window_manager_.get() != NULL; | 220 return maximize_mode_window_manager_.get() != NULL; |
221 } | 221 } |
222 | 222 |
| 223 void MaximizeModeController::AddWindow(aura::Window* window) { |
| 224 if (IsMaximizeModeWindowManagerEnabled()) |
| 225 maximize_mode_window_manager_->AddWindow(window); |
| 226 } |
| 227 |
223 void MaximizeModeController::Shutdown() { | 228 void MaximizeModeController::Shutdown() { |
224 maximize_mode_window_manager_.reset(); | 229 maximize_mode_window_manager_.reset(); |
225 Shell::GetInstance()->OnMaximizeModeEnded(); | 230 Shell::GetInstance()->OnMaximizeModeEnded(); |
226 } | 231 } |
227 | 232 |
228 void MaximizeModeController::OnAccelerometerUpdated( | 233 void MaximizeModeController::OnAccelerometerUpdated( |
229 const gfx::Vector3dF& base, | 234 const gfx::Vector3dF& base, |
230 const gfx::Vector3dF& lid) { | 235 const gfx::Vector3dF& lid) { |
231 have_seen_accelerometer_data_ = true; | 236 have_seen_accelerometer_data_ = true; |
232 | 237 |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
486 return elapsed_time <= kLidRecentlyOpenedDuration; | 491 return elapsed_time <= kLidRecentlyOpenedDuration; |
487 } | 492 } |
488 | 493 |
489 void MaximizeModeController::SetTickClockForTest( | 494 void MaximizeModeController::SetTickClockForTest( |
490 scoped_ptr<base::TickClock> tick_clock) { | 495 scoped_ptr<base::TickClock> tick_clock) { |
491 DCHECK(tick_clock_); | 496 DCHECK(tick_clock_); |
492 tick_clock_ = tick_clock.Pass(); | 497 tick_clock_ = tick_clock.Pass(); |
493 } | 498 } |
494 | 499 |
495 } // namespace ash | 500 } // namespace ash |
OLD | NEW |