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 COMPONENTS_TEST_RUNNER_MOCK_SCREEN_ORIENTATION_CLIENT_H_ | 5 #ifndef COMPONENTS_TEST_RUNNER_MOCK_SCREEN_ORIENTATION_CLIENT_H_ |
6 #define COMPONENTS_TEST_RUNNER_MOCK_SCREEN_ORIENTATION_CLIENT_H_ | 6 #define COMPONENTS_TEST_RUNNER_MOCK_SCREEN_ORIENTATION_CLIENT_H_ |
7 | 7 |
| 8 #include <memory> |
| 9 |
8 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
9 #include "base/macros.h" | 11 #include "base/macros.h" |
10 #include "components/test_runner/test_runner_export.h" | 12 #include "components/test_runner/test_runner_export.h" |
11 #include "third_party/WebKit/public/platform/modules/screen_orientation/WebLockO
rientationCallback.h" | 13 #include "third_party/WebKit/public/platform/modules/screen_orientation/WebLockO
rientationCallback.h" |
12 #include "third_party/WebKit/public/platform/modules/screen_orientation/WebScree
nOrientationClient.h" | 14 #include "third_party/WebKit/public/platform/modules/screen_orientation/WebScree
nOrientationClient.h" |
13 #include "third_party/WebKit/public/platform/modules/screen_orientation/WebScree
nOrientationLockType.h" | 15 #include "third_party/WebKit/public/platform/modules/screen_orientation/WebScree
nOrientationLockType.h" |
14 #include "third_party/WebKit/public/platform/modules/screen_orientation/WebScree
nOrientationType.h" | 16 #include "third_party/WebKit/public/platform/modules/screen_orientation/WebScree
nOrientationType.h" |
15 | 17 |
16 namespace blink { | 18 namespace blink { |
17 class WebLocalFrame; | 19 class WebLocalFrame; |
(...skipping 11 matching lines...) Expand all Loading... |
29 void UpdateDeviceOrientation(blink::WebLocalFrame* main_frame, | 31 void UpdateDeviceOrientation(blink::WebLocalFrame* main_frame, |
30 blink::WebScreenOrientationType orientation); | 32 blink::WebScreenOrientationType orientation); |
31 | 33 |
32 blink::WebScreenOrientationType CurrentOrientationType() const; | 34 blink::WebScreenOrientationType CurrentOrientationType() const; |
33 unsigned CurrentOrientationAngle() const; | 35 unsigned CurrentOrientationAngle() const; |
34 bool IsDisabled() const { return is_disabled_; } | 36 bool IsDisabled() const { return is_disabled_; } |
35 void SetDisabled(bool disabled); | 37 void SetDisabled(bool disabled); |
36 | 38 |
37 private: | 39 private: |
38 // From blink::WebScreenOrientationClient. | 40 // From blink::WebScreenOrientationClient. |
39 void lockOrientation(blink::WebScreenOrientationLockType orientation, | 41 void lockOrientation( |
40 blink::WebLockOrientationCallback* callback) override; | 42 blink::WebScreenOrientationLockType orientation, |
| 43 std::unique_ptr<blink::WebLockOrientationCallback> callback) override; |
41 void unlockOrientation() override; | 44 void unlockOrientation() override; |
42 | 45 |
43 void UpdateLockSync(blink::WebScreenOrientationLockType, | 46 void UpdateLockSync(blink::WebScreenOrientationLockType, |
44 blink::WebLockOrientationCallback*); | 47 std::unique_ptr<blink::WebLockOrientationCallback>); |
45 void ResetLockSync(); | 48 void ResetLockSync(); |
46 | 49 |
47 void UpdateScreenOrientation(blink::WebScreenOrientationType); | 50 void UpdateScreenOrientation(blink::WebScreenOrientationType); |
48 bool IsOrientationAllowedByCurrentLock(blink::WebScreenOrientationType); | 51 bool IsOrientationAllowedByCurrentLock(blink::WebScreenOrientationType); |
49 blink::WebScreenOrientationType SuitableOrientationForCurrentLock(); | 52 blink::WebScreenOrientationType SuitableOrientationForCurrentLock(); |
50 static unsigned OrientationTypeToAngle(blink::WebScreenOrientationType); | 53 static unsigned OrientationTypeToAngle(blink::WebScreenOrientationType); |
51 | 54 |
52 blink::WebLocalFrame* main_frame_; | 55 blink::WebLocalFrame* main_frame_; |
53 blink::WebScreenOrientationLockType current_lock_; | 56 blink::WebScreenOrientationLockType current_lock_; |
54 blink::WebScreenOrientationType device_orientation_; | 57 blink::WebScreenOrientationType device_orientation_; |
55 blink::WebScreenOrientationType current_orientation_; | 58 blink::WebScreenOrientationType current_orientation_; |
56 bool is_disabled_; | 59 bool is_disabled_; |
57 | 60 |
58 DISALLOW_COPY_AND_ASSIGN(MockScreenOrientationClient); | 61 DISALLOW_COPY_AND_ASSIGN(MockScreenOrientationClient); |
59 }; | 62 }; |
60 | 63 |
61 } // namespace test_runner | 64 } // namespace test_runner |
62 | 65 |
63 #endif // COMPONENTS_TEST_RUNNER_MOCK_SCREEN_ORIENTATION_CLIENT_H_ | 66 #endif // COMPONENTS_TEST_RUNNER_MOCK_SCREEN_ORIENTATION_CLIENT_H_ |
OLD | NEW |