| 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 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 } else if (!enable && maximize_mode_window_manager_.get()) { | 189 } else if (!enable && maximize_mode_window_manager_.get()) { |
| 190 maximize_mode_window_manager_.reset(); | 190 maximize_mode_window_manager_.reset(); |
| 191 Shell::GetInstance()->OnMaximizeModeEnded(); | 191 Shell::GetInstance()->OnMaximizeModeEnded(); |
| 192 } | 192 } |
| 193 } | 193 } |
| 194 | 194 |
| 195 bool MaximizeModeController::IsMaximizeModeWindowManagerEnabled() const { | 195 bool MaximizeModeController::IsMaximizeModeWindowManagerEnabled() const { |
| 196 return maximize_mode_window_manager_.get() != NULL; | 196 return maximize_mode_window_manager_.get() != NULL; |
| 197 } | 197 } |
| 198 | 198 |
| 199 void MaximizeModeController::AddWindow(aura::Window* window) { |
| 200 if (IsMaximizeModeWindowManagerEnabled()) |
| 201 maximize_mode_window_manager_->AddWindow(window); |
| 202 } |
| 203 |
| 199 void MaximizeModeController::Shutdown() { | 204 void MaximizeModeController::Shutdown() { |
| 200 maximize_mode_window_manager_.reset(); | 205 maximize_mode_window_manager_.reset(); |
| 201 Shell::GetInstance()->OnMaximizeModeEnded(); | 206 Shell::GetInstance()->OnMaximizeModeEnded(); |
| 202 } | 207 } |
| 203 | 208 |
| 204 void MaximizeModeController::OnAccelerometerUpdated( | 209 void MaximizeModeController::OnAccelerometerUpdated( |
| 205 const gfx::Vector3dF& base, | 210 const gfx::Vector3dF& base, |
| 206 const gfx::Vector3dF& lid) { | 211 const gfx::Vector3dF& lid) { |
| 207 have_seen_accelerometer_data_ = true; | 212 have_seen_accelerometer_data_ = true; |
| 208 | 213 |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 422 total_non_touchview_time_; | 427 total_non_touchview_time_; |
| 423 if (total_runtime.InSeconds() > 0) { | 428 if (total_runtime.InSeconds() > 0) { |
| 424 UMA_HISTOGRAM_PERCENTAGE("Ash.TouchView.TouchViewActivePercentage", | 429 UMA_HISTOGRAM_PERCENTAGE("Ash.TouchView.TouchViewActivePercentage", |
| 425 100 * total_touchview_time_.InSeconds() / total_runtime.InSeconds()); | 430 100 * total_touchview_time_.InSeconds() / total_runtime.InSeconds()); |
| 426 } | 431 } |
| 427 } | 432 } |
| 428 Shell::GetInstance()->display_controller()->RemoveObserver(this); | 433 Shell::GetInstance()->display_controller()->RemoveObserver(this); |
| 429 } | 434 } |
| 430 | 435 |
| 431 } // namespace ash | 436 } // namespace ash |
| OLD | NEW |