OLD | NEW |
---|---|
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 #ifndef CONTENT_RENDERER_SCREEN_ORIENTATION_MOCK_SCREEN_ORIENTATION_CONTROLLER_H _ | 5 #ifndef CONTENT_SHELL_RENDERER_TEST_RUNNER_MOCK_SCREEN_ORIENTATION_CONTROLLER_H_ |
6 #define CONTENT_RENDERER_SCREEN_ORIENTATION_MOCK_SCREEN_ORIENTATION_CONTROLLER_H _ | 6 #define CONTENT_SHELL_RENDERER_TEST_RUNNER_MOCK_SCREEN_ORIENTATION_CONTROLLER_H_ |
7 | 7 |
8 #include "base/lazy_instance.h" | |
9 #include "base/macros.h" | 8 #include "base/macros.h" |
10 #include "base/memory/ref_counted.h" | 9 #include "third_party/WebKit/public/platform/WebLockOrientationCallback.h" |
11 #include "content/public/renderer/render_view_observer.h" | 10 #include "third_party/WebKit/public/platform/WebScreenOrientationClient.h" |
12 #include "third_party/WebKit/public/platform/WebScreenOrientationLockType.h" | 11 #include "third_party/WebKit/public/platform/WebScreenOrientationLockType.h" |
13 #include "third_party/WebKit/public/platform/WebScreenOrientationType.h" | 12 #include "third_party/WebKit/public/platform/WebScreenOrientationType.h" |
14 | 13 |
15 namespace content { | 14 namespace content { |
16 class RenderView; | 15 class RenderView; |
17 class RenderViewImpl; | 16 class RenderViewImpl; |
18 | 17 |
19 class MockScreenOrientationController | 18 class MockScreenOrientationController |
mlamouri (slow - plz ping)
2014/06/18 13:47:42
Can you call this MockScreenOrientationClient?
| |
20 : public base::RefCountedThreadSafe<MockScreenOrientationController>, | 19 : public blink::WebScreenOrientationClient { |
21 public RenderViewObserver { | |
22 public: | 20 public: |
23 MockScreenOrientationController(); | 21 explicit MockScreenOrientationController(); |
22 virtual ~MockScreenOrientationController(); | |
24 | 23 |
25 void ResetData(); | 24 void ResetData(); |
26 void UpdateDeviceOrientation(RenderView* render_view, | 25 void UpdateDeviceOrientation(RenderView* render_view, |
27 blink::WebScreenOrientationType); | 26 blink::WebScreenOrientationType); |
28 | 27 |
29 private: | 28 private: |
30 virtual ~MockScreenOrientationController(); | 29 // From blink::WebScreenOrientationClient. |
30 virtual void lockOrientation(blink::WebScreenOrientationLockType, | |
31 blink::WebLockOrientationCallback*); | |
32 virtual void unlockOrientation(); | |
33 | |
34 void UpdateLockSync(blink::WebScreenOrientationLockType, | |
35 blink::WebLockOrientationCallback*); | |
36 void ResetLockSync(); | |
31 | 37 |
32 void UpdateScreenOrientation(blink::WebScreenOrientationType); | 38 void UpdateScreenOrientation(blink::WebScreenOrientationType); |
33 bool IsOrientationAllowedByCurrentLock(blink::WebScreenOrientationType); | 39 bool IsOrientationAllowedByCurrentLock(blink::WebScreenOrientationType); |
34 RenderViewImpl* render_view_impl() const; | 40 blink::WebScreenOrientationType SuitableOrientationForCurrentLock(); |
35 | 41 |
36 // RenderViewObserver | 42 RenderView* render_view_; |
37 virtual void OnDestruct() OVERRIDE; | |
38 | |
39 blink::WebScreenOrientationLockType current_lock_; | 43 blink::WebScreenOrientationLockType current_lock_; |
40 blink::WebScreenOrientationType device_orientation_; | 44 blink::WebScreenOrientationType device_orientation_; |
41 blink::WebScreenOrientationType current_orientation_; | 45 blink::WebScreenOrientationType current_orientation_; |
42 | 46 |
43 DISALLOW_COPY_AND_ASSIGN(MockScreenOrientationController); | 47 DISALLOW_COPY_AND_ASSIGN(MockScreenOrientationController); |
44 friend class base::LazyInstance<MockScreenOrientationController>; | |
45 friend class base::RefCountedThreadSafe<MockScreenOrientationController>; | |
46 }; | 48 }; |
47 | 49 |
48 } // namespace content | 50 } // namespace content |
49 | 51 |
50 #endif // CONTENT_RENDERER_SCREEN_ORIENTATION_MOCK_SCREEN_ORIENTATION_CONTROLLER _H_ | 52 #endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_MOCK_SCREEN_ORIENTATION_CONTROLLER _H_ |
OLD | NEW |