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

Side by Side Diff: content/shell/renderer/test_runner/mock_screen_orientation_client.h

Issue 339913002: Move MockScreenOrientationController to content/shell/renderer/test_runner/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix layer violation Created 6 years, 6 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 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_SHELL_RENDERER_TEST_RUNNER_MOCK_SCREEN_ORIENTATION_CLIENT_H_
6 #define CONTENT_SHELL_RENDERER_TEST_RUNNER_MOCK_SCREEN_ORIENTATION_CLIENT_H_
7
8 #include "base/macros.h"
9 #include "third_party/WebKit/public/platform/WebLockOrientationCallback.h"
10 #include "third_party/WebKit/public/platform/WebScreenOrientationClient.h"
11 #include "third_party/WebKit/public/platform/WebScreenOrientationLockType.h"
12 #include "third_party/WebKit/public/platform/WebScreenOrientationType.h"
13
14 namespace blink {
15 class WebFrame;
16 }
17
18 namespace content {
19
20 class MockScreenOrientationClient : public blink::WebScreenOrientationClient {
21 public:
22 explicit MockScreenOrientationClient();
23 virtual ~MockScreenOrientationClient();
24
25 void ResetData();
26 void UpdateDeviceOrientation(blink::WebFrame*,
27 blink::WebScreenOrientationType);
28
29 blink::WebScreenOrientationType CurrentOrientationType() const;
30 unsigned CurrentOrientationAngle() const;
31
32 private:
33 // From blink::WebScreenOrientationClient.
34 virtual void lockOrientation(blink::WebScreenOrientationLockType,
35 blink::WebLockOrientationCallback*);
36 virtual void unlockOrientation();
37
38 void UpdateLockSync(blink::WebScreenOrientationLockType,
39 blink::WebLockOrientationCallback*);
40 void ResetLockSync();
41
42 void UpdateScreenOrientation(blink::WebScreenOrientationType);
43 bool IsOrientationAllowedByCurrentLock(blink::WebScreenOrientationType);
44 blink::WebScreenOrientationType SuitableOrientationForCurrentLock();
45 static unsigned OrientationTypeToAngle(blink::WebScreenOrientationType);
46
47 blink::WebFrame* main_frame_;
48 blink::WebScreenOrientationLockType current_lock_;
49 blink::WebScreenOrientationType device_orientation_;
50 blink::WebScreenOrientationType current_orientation_;
51
52 DISALLOW_COPY_AND_ASSIGN(MockScreenOrientationClient);
53 };
54
55 } // namespace content
56
57 #endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_MOCK_SCREEN_ORIENTATION_CONTROLLER _H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698