Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(280)

Side by Side Diff: ash/wm/maximize_mode/maximize_mode_controller.cc

Issue 437213005: Fixing problem with the maximize mode where MultiProfile windows do not get properly handled (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698