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

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

Issue 300063012: Make async methods UpdateLock() and ResetLock() in MockScreenOrientationController. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix clang build. 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/macros.h" 9 #include "base/macros.h"
10 #include "base/memory/ref_counted.h"
9 #include "third_party/WebKit/public/platform/WebScreenOrientationLockType.h" 11 #include "third_party/WebKit/public/platform/WebScreenOrientationLockType.h"
10 #include "third_party/WebKit/public/platform/WebScreenOrientationType.h" 12 #include "third_party/WebKit/public/platform/WebScreenOrientationType.h"
11 13
12 namespace blink { 14 namespace blink {
13 class WebScreenOrientationListener; 15 class WebScreenOrientationListener;
14 } 16 }
15 17
16 namespace content { 18 namespace content {
17 19
18 class MockScreenOrientationController { 20 class MockScreenOrientationController
21 : public base::RefCountedThreadSafe<MockScreenOrientationController> {
19 public: 22 public:
20 MockScreenOrientationController(); 23 MockScreenOrientationController();
21 24
22 void SetListener(blink::WebScreenOrientationListener* listener); 25 void SetListener(blink::WebScreenOrientationListener* listener);
23 void ResetData(); 26 void ResetData();
24 void UpdateLock(blink::WebScreenOrientationLockType); 27 void UpdateLock(blink::WebScreenOrientationLockType);
25 void ResetLock(); 28 void ResetLock();
26 void UpdateDeviceOrientation(blink::WebScreenOrientationType); 29 void UpdateDeviceOrientation(blink::WebScreenOrientationType);
27 30
28 private: 31 private:
32 // Private destructor to make clang compiler checks happy.
33 ~MockScreenOrientationController() { }
mlamouri (slow - plz ping) 2014/05/28 13:23:24 Please, make the dtor virtual, remove the comment
ostap 2014/05/28 14:40:21 Done.
34
35 void UpdateLockSync(blink::WebScreenOrientationLockType);
36 void ResetLockSync();
29 void UpdateScreenOrientation(blink::WebScreenOrientationType); 37 void UpdateScreenOrientation(blink::WebScreenOrientationType);
30 bool IsOrientationAllowedByCurrentLock(blink::WebScreenOrientationType); 38 bool IsOrientationAllowedByCurrentLock(blink::WebScreenOrientationType);
31 blink::WebScreenOrientationType SuitableOrientationForCurrentLock(); 39 blink::WebScreenOrientationType SuitableOrientationForCurrentLock();
32 40
33 blink::WebScreenOrientationLockType current_lock_; 41 blink::WebScreenOrientationLockType current_lock_;
34 blink::WebScreenOrientationType device_orientation_; 42 blink::WebScreenOrientationType device_orientation_;
35 blink::WebScreenOrientationType current_orientation_; 43 blink::WebScreenOrientationType current_orientation_;
36 blink::WebScreenOrientationListener* listener_; 44 blink::WebScreenOrientationListener* listener_;
37 45
38 DISALLOW_COPY_AND_ASSIGN(MockScreenOrientationController); 46 DISALLOW_COPY_AND_ASSIGN(MockScreenOrientationController);
47 friend class base::LazyInstance<MockScreenOrientationController>;
48 friend class base::RefCountedThreadSafe<MockScreenOrientationController>;
39 }; 49 };
40 50
41 } // namespace content 51 } // namespace content
42 52
43 #endif // CONTENT_RENDERER_SCREEN_ORIENTATION_MOCK_SCREEN_ORIENTATION_CONTROLLER _H_ 53 #endif // CONTENT_RENDERER_SCREEN_ORIENTATION_MOCK_SCREEN_ORIENTATION_CONTROLLER _H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698