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

Side by Side Diff: Source/modules/screen_orientation/ScreenOrientation.cpp

Issue 200893004: Remove the ability to lock to multiple orientations. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 9 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
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 "config.h" 5 #include "config.h"
6 #include "modules/screen_orientation/ScreenOrientation.h" 6 #include "modules/screen_orientation/ScreenOrientation.h"
7 7
8 #include "core/frame/DOMWindow.h" 8 #include "core/frame/DOMWindow.h"
9 #include "core/frame/LocalFrame.h" 9 #include "core/frame/LocalFrame.h"
10 #include "core/frame/Screen.h" 10 #include "core/frame/Screen.h"
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 123
124 const AtomicString& ScreenOrientation::orientation(Screen& screen) 124 const AtomicString& ScreenOrientation::orientation(Screen& screen)
125 { 125 {
126 ScreenOrientation& screenOrientation = ScreenOrientation::from(screen); 126 ScreenOrientation& screenOrientation = ScreenOrientation::from(screen);
127 if (!screenOrientation.document()) 127 if (!screenOrientation.document())
128 return emptyAtom; 128 return emptyAtom;
129 ScreenOrientationController& controller = ScreenOrientationController::from( *screenOrientation.document()); 129 ScreenOrientationController& controller = ScreenOrientationController::from( *screenOrientation.document());
130 return orientationToString(controller.orientation()); 130 return orientationToString(controller.orientation());
131 } 131 }
132 132
133 bool ScreenOrientation::lockOrientation(Screen& screen, const Vector<String>& or ientationsVector)
Inactive 2014/03/15 00:29:52 I think you forgot to remove it from the header as
mlamouri (slow - plz ping) 2014/03/15 00:54:47 Indeed. The all_webkit target was pretty happy wit
134 {
135 blink::WebScreenOrientations orientations = 0;
136 for (size_t i = 0; i < orientationsVector.size(); ++i) {
137 blink::WebScreenOrientations currentOrientation = stringToOrientations(A tomicString(orientationsVector[i]));
138 if (!currentOrientation)
139 return false;
140 orientations |= currentOrientation;
141 }
142 if (!orientations)
143 return false;
144 ScreenOrientation::from(screen).lockOrientationAsync(orientations);
145 return true;
146 }
147
148 bool ScreenOrientation::lockOrientation(Screen& screen, const AtomicString& orie ntationString) 133 bool ScreenOrientation::lockOrientation(Screen& screen, const AtomicString& orie ntationString)
149 { 134 {
150 blink::WebScreenOrientations orientations = stringToOrientations(orientation String); 135 blink::WebScreenOrientations orientations = stringToOrientations(orientation String);
Inactive 2014/03/15 00:31:24 Does this mean we can drop WebScreenOrientations a
mlamouri (slow - plz ping) 2014/03/15 00:54:47 Yes, we can get ride of WebScreenOrientations but
151 if (!orientations) 136 if (!orientations)
152 return false; 137 return false;
153 ScreenOrientation::from(screen).lockOrientationAsync(orientations); 138 ScreenOrientation::from(screen).lockOrientationAsync(orientations);
154 return true; 139 return true;
155 } 140 }
156 141
157 void ScreenOrientation::unlockOrientation(Screen& screen) 142 void ScreenOrientation::unlockOrientation(Screen& screen)
158 { 143 {
159 ScreenOrientation::from(screen).lockOrientationAsync(WebScreenOrientationDef ault); 144 ScreenOrientation::from(screen).lockOrientationAsync(WebScreenOrientationDef ault);
160 } 145 }
161 146
162 } // namespace WebCore 147 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698