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

Side by Side Diff: ash/display/screen_orientation_controller_chromeos.cc

Issue 2421853003: Remove usage of FOR_EACH_OBSERVER macro in ash/ (Closed)
Patch Set: shell_observers Created 4 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/display/display_manager.cc ('k') | ash/display/window_tree_host_manager.cc » ('j') | 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/display/screen_orientation_controller_chromeos.h" 5 #include "ash/display/screen_orientation_controller_chromeos.h"
6 6
7 #include "ash/common/ash_switches.h" 7 #include "ash/common/ash_switches.h"
8 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h" 8 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h"
9 #include "ash/common/wm_shell.h" 9 #include "ash/common/wm_shell.h"
10 #include "ash/common/wm_window.h" 10 #include "ash/common/wm_window.h"
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 !base::CommandLine::ForCurrentProcess()->HasSwitch( 125 !base::CommandLine::ForCurrentProcess()->HasSwitch(
126 switches::kAshDisableScreenOrientationLock); 126 switches::kAshDisableScreenOrientationLock);
127 } 127 }
128 128
129 void ScreenOrientationController::SetRotationLocked(bool rotation_locked) { 129 void ScreenOrientationController::SetRotationLocked(bool rotation_locked) {
130 if (rotation_locked_ == rotation_locked) 130 if (rotation_locked_ == rotation_locked)
131 return; 131 return;
132 rotation_locked_ = rotation_locked; 132 rotation_locked_ = rotation_locked;
133 if (!rotation_locked_) 133 if (!rotation_locked_)
134 rotation_locked_orientation_ = blink::WebScreenOrientationLockAny; 134 rotation_locked_orientation_ = blink::WebScreenOrientationLockAny;
135 FOR_EACH_OBSERVER(Observer, observers_, 135 for (auto& observer : observers_)
136 OnRotationLockChanged(rotation_locked_)); 136 observer.OnRotationLockChanged(rotation_locked_);
137 if (!display::Display::HasInternalDisplay()) 137 if (!display::Display::HasInternalDisplay())
138 return; 138 return;
139 base::AutoReset<bool> auto_ignore_display_configuration_updates( 139 base::AutoReset<bool> auto_ignore_display_configuration_updates(
140 &ignore_display_configuration_updates_, true); 140 &ignore_display_configuration_updates_, true);
141 Shell::GetInstance()->display_manager()->RegisterDisplayRotationProperties( 141 Shell::GetInstance()->display_manager()->RegisterDisplayRotationProperties(
142 rotation_locked_, current_rotation_); 142 rotation_locked_, current_rotation_);
143 } 143 }
144 144
145 void ScreenOrientationController::SetDisplayRotation( 145 void ScreenOrientationController::SetDisplayRotation(
146 display::Display::Rotation rotation, 146 display::Display::Rotation rotation,
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
418 } 418 }
419 419
420 bool ScreenOrientationController::CanRotateInLockedState() { 420 bool ScreenOrientationController::CanRotateInLockedState() {
421 return rotation_locked_orientation_ == 421 return rotation_locked_orientation_ ==
422 blink::WebScreenOrientationLockLandscape || 422 blink::WebScreenOrientationLockLandscape ||
423 rotation_locked_orientation_ == 423 rotation_locked_orientation_ ==
424 blink::WebScreenOrientationLockPortrait; 424 blink::WebScreenOrientationLockPortrait;
425 } 425 }
426 426
427 } // namespace ash 427 } // namespace ash
OLDNEW
« no previous file with comments | « ash/display/display_manager.cc ('k') | ash/display/window_tree_host_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698