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

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

Issue 648733003: Implement ScreenOrientationDelegate on ChromeOS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
« no previous file with comments | « ash/wm/maximize_mode/maximize_mode_controller.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 return; 145 return;
146 base::AutoReset<bool> auto_ignore_display_configuration_updates( 146 base::AutoReset<bool> auto_ignore_display_configuration_updates(
147 &ignore_display_configuration_updates_, true); 147 &ignore_display_configuration_updates_, true);
148 rotation_locked_ = rotation_locked; 148 rotation_locked_ = rotation_locked;
149 Shell::GetInstance()->display_manager()-> 149 Shell::GetInstance()->display_manager()->
150 RegisterDisplayRotationProperties(rotation_locked_, current_rotation_); 150 RegisterDisplayRotationProperties(rotation_locked_, current_rotation_);
151 FOR_EACH_OBSERVER(Observer, observers_, 151 FOR_EACH_OBSERVER(Observer, observers_,
152 OnRotationLockChanged(rotation_locked_)); 152 OnRotationLockChanged(rotation_locked_));
153 } 153 }
154 154
155 void MaximizeModeController::LockRotation(gfx::Display::Rotation rotation) {
156 SetRotationLocked(true);
157 SetDisplayRotation(Shell::GetInstance()->display_manager(), rotation);
flackr 2014/10/27 15:12:06 So if multiple consumers try to lock different ori
jonross 2014/10/27 18:18:48 For the Javascript api, currently when full-screen
flackr 2014/10/27 18:45:19 This does not seem to be the case. I can open http
jonross 2014/10/27 21:36:01 Definitely a problem. So on Chrome OS the active
158 }
159
155 void MaximizeModeController::AddObserver(Observer* observer) { 160 void MaximizeModeController::AddObserver(Observer* observer) {
156 observers_.AddObserver(observer); 161 observers_.AddObserver(observer);
157 } 162 }
158 163
159 void MaximizeModeController::RemoveObserver(Observer* observer) { 164 void MaximizeModeController::RemoveObserver(Observer* observer) {
160 observers_.RemoveObserver(observer); 165 observers_.RemoveObserver(observer);
161 } 166 }
162 167
163 bool MaximizeModeController::CanEnterMaximizeMode() { 168 bool MaximizeModeController::CanEnterMaximizeMode() {
164 // If we have ever seen accelerometer data, then HandleHingeRotation may 169 // If we have ever seen accelerometer data, then HandleHingeRotation may
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after
490 return elapsed_time <= kLidRecentlyOpenedDuration; 495 return elapsed_time <= kLidRecentlyOpenedDuration;
491 } 496 }
492 497
493 void MaximizeModeController::SetTickClockForTest( 498 void MaximizeModeController::SetTickClockForTest(
494 scoped_ptr<base::TickClock> tick_clock) { 499 scoped_ptr<base::TickClock> tick_clock) {
495 DCHECK(tick_clock_); 500 DCHECK(tick_clock_);
496 tick_clock_ = tick_clock.Pass(); 501 tick_clock_ = tick_clock.Pass();
497 } 502 }
498 503
499 } // namespace ash 504 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/maximize_mode/maximize_mode_controller.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698