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

Unified Diff: content/shell/renderer/test_runner/mock_screen_orientation_client.h

Issue 339913002: Move MockScreenOrientationController to content/shell/renderer/test_runner/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix layer violation 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 side-by-side diff with in-line comments
Download patch
Index: content/shell/renderer/test_runner/mock_screen_orientation_client.h
diff --git a/content/shell/renderer/test_runner/mock_screen_orientation_client.h b/content/shell/renderer/test_runner/mock_screen_orientation_client.h
new file mode 100644
index 0000000000000000000000000000000000000000..147bb2be631cf8a1227417b4d80b72cb1bf0e728
--- /dev/null
+++ b/content/shell/renderer/test_runner/mock_screen_orientation_client.h
@@ -0,0 +1,57 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_SHELL_RENDERER_TEST_RUNNER_MOCK_SCREEN_ORIENTATION_CLIENT_H_
+#define CONTENT_SHELL_RENDERER_TEST_RUNNER_MOCK_SCREEN_ORIENTATION_CLIENT_H_
+
+#include "base/macros.h"
+#include "third_party/WebKit/public/platform/WebLockOrientationCallback.h"
+#include "third_party/WebKit/public/platform/WebScreenOrientationClient.h"
+#include "third_party/WebKit/public/platform/WebScreenOrientationLockType.h"
+#include "third_party/WebKit/public/platform/WebScreenOrientationType.h"
+
+namespace blink {
+class WebFrame;
+}
+
+namespace content {
+
+class MockScreenOrientationClient : public blink::WebScreenOrientationClient {
+ public:
+ explicit MockScreenOrientationClient();
+ virtual ~MockScreenOrientationClient();
+
+ void ResetData();
+ void UpdateDeviceOrientation(blink::WebFrame*,
+ blink::WebScreenOrientationType);
+
+ blink::WebScreenOrientationType CurrentOrientationType() const;
+ unsigned CurrentOrientationAngle() const;
+
+ private:
+ // From blink::WebScreenOrientationClient.
+ virtual void lockOrientation(blink::WebScreenOrientationLockType,
+ blink::WebLockOrientationCallback*);
+ virtual void unlockOrientation();
+
+ void UpdateLockSync(blink::WebScreenOrientationLockType,
+ blink::WebLockOrientationCallback*);
+ void ResetLockSync();
+
+ void UpdateScreenOrientation(blink::WebScreenOrientationType);
+ bool IsOrientationAllowedByCurrentLock(blink::WebScreenOrientationType);
+ blink::WebScreenOrientationType SuitableOrientationForCurrentLock();
+ static unsigned OrientationTypeToAngle(blink::WebScreenOrientationType);
+
+ blink::WebFrame* main_frame_;
+ blink::WebScreenOrientationLockType current_lock_;
+ blink::WebScreenOrientationType device_orientation_;
+ blink::WebScreenOrientationType current_orientation_;
+
+ DISALLOW_COPY_AND_ASSIGN(MockScreenOrientationClient);
+};
+
+} // namespace content
+
+#endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_MOCK_SCREEN_ORIENTATION_CONTROLLER_H_

Powered by Google App Engine
This is Rietveld 408576698