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

Side by Side Diff: content/renderer/screen_orientation/mock_screen_orientation_controller.h

Issue 268673015: Support screen.lockOrientation() / screen.unlockOrientation() when running layout tests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Take jochen's feedback into consideration Created 6 years, 7 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
(Empty)
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_RENDERER_SCREEN_ORIENTATION_MOCK_SCREEN_ORIENTATION_CONTROLLER_H _
6 #define CONTENT_RENDERER_SCREEN_ORIENTATION_MOCK_SCREEN_ORIENTATION_CONTROLLER_H _
7
8 #include "base/macros.h"
9 #include "third_party/WebKit/public/platform/WebScreenOrientationLockType.h"
10 #include "third_party/WebKit/public/platform/WebScreenOrientationType.h"
11
12 namespace blink {
13 class WebScreenOrientationListener;
14 }
15
16 namespace content {
17
18 class MockScreenOrientationController {
19 public:
20 MockScreenOrientationController();
21
22 void SetListener(blink::WebScreenOrientationListener* listener);
23 void ResetData();
24 void UpdateLock(blink::WebScreenOrientationLockType);
25 void ResetLock();
26 void UpdateDeviceOrientation(blink::WebScreenOrientationType);
27
28 private:
29 void UpdateScreenOrientation(blink::WebScreenOrientationType);
30 bool IsOrientationAllowedByCurrentLock(blink::WebScreenOrientationType);
31 blink::WebScreenOrientationType SuitableOrientationForCurrentLock();
32
33 blink::WebScreenOrientationLockType current_lock_;
34 blink::WebScreenOrientationType device_orientation_;
35 blink::WebScreenOrientationType current_orientation_;
36 blink::WebScreenOrientationListener* listener_;
37
38 DISALLOW_COPY_AND_ASSIGN(MockScreenOrientationController);
39 };
40
41 } // namespace content
42
43 #endif // CONTENT_RENDERER_SCREEN_ORIENTATION_MOCK_SCREEN_ORIENTATION_CONTROLLER _H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698