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

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

Issue 323663002: Revert of 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/lazy_instance.h" 8 #include "base/lazy_instance.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
11 #include "content/public/renderer/render_view_observer.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 blink { 14 namespace blink {
16 class WebScreenOrientationListener; 15 class WebScreenOrientationListener;
17 } 16 }
18 17
19 namespace content { 18 namespace content {
20 class RenderView;
21 class RenderViewImpl;
22 19
23 class MockScreenOrientationController 20 class MockScreenOrientationController
24 : public base::RefCountedThreadSafe<MockScreenOrientationController>, 21 : public base::RefCountedThreadSafe<MockScreenOrientationController> {
25 public RenderViewObserver {
26 public: 22 public:
27 MockScreenOrientationController(); 23 MockScreenOrientationController();
28 24
29 void SetListener(blink::WebScreenOrientationListener* listener); 25 void SetListener(blink::WebScreenOrientationListener* listener);
30 void ResetData(); 26 void ResetData();
31 void UpdateLock(blink::WebScreenOrientationLockType); 27 void UpdateLock(blink::WebScreenOrientationLockType);
32 void ResetLock(); 28 void ResetLock();
33 void UpdateDeviceOrientation( 29 void UpdateDeviceOrientation(blink::WebScreenOrientationType);
34 RenderView* render_view,
35 blink::WebScreenOrientationType);
36 30
37 private: 31 private:
38 virtual ~MockScreenOrientationController(); 32 virtual ~MockScreenOrientationController();
39 33
40 void UpdateLockSync(blink::WebScreenOrientationLockType); 34 void UpdateLockSync(blink::WebScreenOrientationLockType);
41 void ResetLockSync(); 35 void ResetLockSync();
42 void UpdateScreenOrientation(blink::WebScreenOrientationType); 36 void UpdateScreenOrientation(blink::WebScreenOrientationType);
43 bool IsOrientationAllowedByCurrentLock(blink::WebScreenOrientationType); 37 bool IsOrientationAllowedByCurrentLock(blink::WebScreenOrientationType);
44 blink::WebScreenOrientationType SuitableOrientationForCurrentLock(); 38 blink::WebScreenOrientationType SuitableOrientationForCurrentLock();
45 RenderViewImpl* render_view_impl() const;
46
47 // RenderViewObserver
48 virtual void OnDestruct() OVERRIDE;
49 39
50 blink::WebScreenOrientationLockType current_lock_; 40 blink::WebScreenOrientationLockType current_lock_;
51 blink::WebScreenOrientationType device_orientation_; 41 blink::WebScreenOrientationType device_orientation_;
52 blink::WebScreenOrientationType current_orientation_; 42 blink::WebScreenOrientationType current_orientation_;
53 blink::WebScreenOrientationListener* listener_; 43 blink::WebScreenOrientationListener* listener_;
54 44
55 DISALLOW_COPY_AND_ASSIGN(MockScreenOrientationController); 45 DISALLOW_COPY_AND_ASSIGN(MockScreenOrientationController);
56 friend class base::LazyInstance<MockScreenOrientationController>; 46 friend class base::LazyInstance<MockScreenOrientationController>;
57 friend class base::RefCountedThreadSafe<MockScreenOrientationController>; 47 friend class base::RefCountedThreadSafe<MockScreenOrientationController>;
58 }; 48 };
59 49
60 } // namespace content 50 } // namespace content
61 51
62 #endif // CONTENT_RENDERER_SCREEN_ORIENTATION_MOCK_SCREEN_ORIENTATION_CONTROLLER _H_ 52 #endif // CONTENT_RENDERER_SCREEN_ORIENTATION_MOCK_SCREEN_ORIENTATION_CONTROLLER _H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698