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

Side by Side Diff: Source/modules/screen_orientation/testing/ScreenOrientationClientMock.h

Issue 132113006: Add initial Blink-side support for the Screen Orientation API (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Update compile-time assertion for matching enum Created 6 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 | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef ScreenOrientationClientMock_h
6 #define ScreenOrientationClientMock_h
7
8 #include "modules/screen_orientation/ScreenOrientationClient.h"
9 #include "platform/Timer.h"
10
11 namespace WebCore {
12
13 class ScreenOrientationController;
14
15 // Provides a mock object for the screen orientation client.
16 class ScreenOrientationClientMock FINAL : public ScreenOrientationClient {
17 public:
18 ScreenOrientationClientMock();
19 virtual ~ScreenOrientationClientMock();
20
21 void setController(ScreenOrientationController*);
22 void setScreenOrientation(ScreenOrientationValue);
23
24 // ScreenOrientationClient API.
25 virtual void lockOrientation(ScreenOrientationValues) OVERRIDE;
26 virtual void unlockOrientation() OVERRIDE;
27
28 private:
29 void asyncUpdateController();
30 void controllerTimerFired(Timer<ScreenOrientationClientMock>*);
31 void maybeUpdateOrientationAfterLocking();
32
33 Timer<ScreenOrientationClientMock> m_controllerTimer;
34 ScreenOrientationController* m_controller;
35 ScreenOrientationValue m_orientation;
36 ScreenOrientationValues m_lockedOrientations;
37 };
38
39 } // namespace WebCore
40
41 #endif // ScreenOrientationClientMock_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698