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

Side by Side Diff: components/test_runner/mock_screen_orientation_client.h

Issue 1711083002: [DevTools] Move screen orientation override to RenderWidgetScreenMetricsEmulator. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 4 years, 10 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
« no previous file with comments | « no previous file | components/test_runner/mock_screen_orientation_client.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #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 "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "components/test_runner/test_runner_export.h" 10 #include "components/test_runner/test_runner_export.h"
(...skipping 13 matching lines...) Expand all
24 public: 24 public:
25 explicit MockScreenOrientationClient(); 25 explicit MockScreenOrientationClient();
26 ~MockScreenOrientationClient() override; 26 ~MockScreenOrientationClient() override;
27 27
28 void ResetData(); 28 void ResetData();
29 void UpdateDeviceOrientation(blink::WebLocalFrame* main_frame, 29 void UpdateDeviceOrientation(blink::WebLocalFrame* main_frame,
30 blink::WebScreenOrientationType orientation); 30 blink::WebScreenOrientationType orientation);
31 31
32 blink::WebScreenOrientationType CurrentOrientationType() const; 32 blink::WebScreenOrientationType CurrentOrientationType() const;
33 unsigned CurrentOrientationAngle() const; 33 unsigned CurrentOrientationAngle() const;
34 bool is_active() const { return is_active_; }
34 35
35 private: 36 private:
36 // From blink::WebScreenOrientationClient. 37 // From blink::WebScreenOrientationClient.
37 void lockOrientation(blink::WebScreenOrientationLockType orientation, 38 void lockOrientation(blink::WebScreenOrientationLockType orientation,
38 blink::WebLockOrientationCallback* callback) override; 39 blink::WebLockOrientationCallback* callback) override;
39 void unlockOrientation() override; 40 void unlockOrientation() override;
40 41
41 void UpdateLockSync(blink::WebScreenOrientationLockType, 42 void UpdateLockSync(blink::WebScreenOrientationLockType,
42 blink::WebLockOrientationCallback*); 43 blink::WebLockOrientationCallback*);
43 void ResetLockSync(); 44 void ResetLockSync();
44 45
45 void UpdateScreenOrientation(blink::WebScreenOrientationType); 46 void UpdateScreenOrientation(blink::WebScreenOrientationType);
46 bool IsOrientationAllowedByCurrentLock(blink::WebScreenOrientationType); 47 bool IsOrientationAllowedByCurrentLock(blink::WebScreenOrientationType);
47 blink::WebScreenOrientationType SuitableOrientationForCurrentLock(); 48 blink::WebScreenOrientationType SuitableOrientationForCurrentLock();
48 static unsigned OrientationTypeToAngle(blink::WebScreenOrientationType); 49 static unsigned OrientationTypeToAngle(blink::WebScreenOrientationType);
49 50
50 blink::WebLocalFrame* main_frame_; 51 blink::WebLocalFrame* main_frame_;
51 blink::WebScreenOrientationLockType current_lock_; 52 blink::WebScreenOrientationLockType current_lock_;
52 blink::WebScreenOrientationType device_orientation_; 53 blink::WebScreenOrientationType device_orientation_;
53 blink::WebScreenOrientationType current_orientation_; 54 blink::WebScreenOrientationType current_orientation_;
55 bool is_active_;
54 56
55 DISALLOW_COPY_AND_ASSIGN(MockScreenOrientationClient); 57 DISALLOW_COPY_AND_ASSIGN(MockScreenOrientationClient);
56 }; 58 };
57 59
58 } // namespace test_runner 60 } // namespace test_runner
59 61
60 #endif // COMPONENTS_TEST_RUNNER_MOCK_SCREEN_ORIENTATION_CLIENT_H_ 62 #endif // COMPONENTS_TEST_RUNNER_MOCK_SCREEN_ORIENTATION_CLIENT_H_
OLDNEW
« no previous file with comments | « no previous file | components/test_runner/mock_screen_orientation_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698