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

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

Issue 302553007: Call RenderViewImpl::SetScreenOrientationForTesting to make sure that events are not sent when orie… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
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 CONTENT_RENDERER_SCREEN_ORIENTATION_MOCK_SCREEN_ORIENTATION_CONTROLLER_H _ 5 #ifndef CONTENT_RENDERER_SCREEN_ORIENTATION_MOCK_SCREEN_ORIENTATION_CONTROLLER_H _
6 #define CONTENT_RENDERER_SCREEN_ORIENTATION_MOCK_SCREEN_ORIENTATION_CONTROLLER_H _ 6 #define CONTENT_RENDERER_SCREEN_ORIENTATION_MOCK_SCREEN_ORIENTATION_CONTROLLER_H _
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "third_party/WebKit/public/platform/WebScreenOrientationLockType.h" 9 #include "third_party/WebKit/public/platform/WebScreenOrientationLockType.h"
10 #include "third_party/WebKit/public/platform/WebScreenOrientationType.h" 10 #include "third_party/WebKit/public/platform/WebScreenOrientationType.h"
11 11
12 namespace blink { 12 namespace blink {
13 class WebScreenOrientationListener; 13 class WebScreenOrientationListener;
14 } 14 }
15 15
16 namespace content { 16 namespace content {
17 class RenderView;
17 18
18 class MockScreenOrientationController { 19 class MockScreenOrientationController {
19 public: 20 public:
20 MockScreenOrientationController(); 21 MockScreenOrientationController();
21 22
22 void SetListener(blink::WebScreenOrientationListener* listener); 23 void SetListener(blink::WebScreenOrientationListener* listener);
23 void ResetData(); 24 void ResetData();
24 void UpdateLock(blink::WebScreenOrientationLockType); 25 void UpdateLock(blink::WebScreenOrientationLockType);
25 void ResetLock(); 26 void ResetLock();
26 void UpdateDeviceOrientation(blink::WebScreenOrientationType); 27 void UpdateDeviceOrientation(
28 RenderView* render_view,
29 blink::WebScreenOrientationType);
30 void ResetRenderView();
27 31
28 private: 32 private:
29 void UpdateScreenOrientation(blink::WebScreenOrientationType); 33 void UpdateScreenOrientation(blink::WebScreenOrientationType);
30 bool IsOrientationAllowedByCurrentLock(blink::WebScreenOrientationType); 34 bool IsOrientationAllowedByCurrentLock(blink::WebScreenOrientationType);
31 blink::WebScreenOrientationType SuitableOrientationForCurrentLock(); 35 blink::WebScreenOrientationType SuitableOrientationForCurrentLock();
32 36
33 blink::WebScreenOrientationLockType current_lock_; 37 blink::WebScreenOrientationLockType current_lock_;
34 blink::WebScreenOrientationType device_orientation_; 38 blink::WebScreenOrientationType device_orientation_;
35 blink::WebScreenOrientationType current_orientation_; 39 blink::WebScreenOrientationType current_orientation_;
36 blink::WebScreenOrientationListener* listener_; 40 blink::WebScreenOrientationListener* listener_;
41 RenderView* render_view_;
37 42
38 DISALLOW_COPY_AND_ASSIGN(MockScreenOrientationController); 43 DISALLOW_COPY_AND_ASSIGN(MockScreenOrientationController);
39 }; 44 };
40 45
41 } // namespace content 46 } // namespace content
42 47
43 #endif // CONTENT_RENDERER_SCREEN_ORIENTATION_MOCK_SCREEN_ORIENTATION_CONTROLLER _H_ 48 #endif // CONTENT_RENDERER_SCREEN_ORIENTATION_MOCK_SCREEN_ORIENTATION_CONTROLLER _H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698