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

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

Issue 339913002: Move MockScreenOrientationController to content/shell/renderer/test_runner/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
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 side-by-side diff with in-line comments
Download patch
Index: content/shell/renderer/test_runner/mock_screen_orientation_controller.h
diff --git a/content/renderer/screen_orientation/mock_screen_orientation_controller.h b/content/shell/renderer/test_runner/mock_screen_orientation_controller.h
similarity index 52%
rename from content/renderer/screen_orientation/mock_screen_orientation_controller.h
rename to content/shell/renderer/test_runner/mock_screen_orientation_controller.h
index 2c9d5a9f77c8434a0118f15703499da7b785a734..e875a7370d7b623c201cc35d2e1ac6494b0616f9 100644
--- a/content/renderer/screen_orientation/mock_screen_orientation_controller.h
+++ b/content/shell/renderer/test_runner/mock_screen_orientation_controller.h
@@ -2,13 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CONTENT_RENDERER_SCREEN_ORIENTATION_MOCK_SCREEN_ORIENTATION_CONTROLLER_H_
-#define CONTENT_RENDERER_SCREEN_ORIENTATION_MOCK_SCREEN_ORIENTATION_CONTROLLER_H_
+#ifndef CONTENT_SHELL_RENDERER_TEST_RUNNER_MOCK_SCREEN_ORIENTATION_CONTROLLER_H_
+#define CONTENT_SHELL_RENDERER_TEST_RUNNER_MOCK_SCREEN_ORIENTATION_CONTROLLER_H_
-#include "base/lazy_instance.h"
#include "base/macros.h"
-#include "base/memory/ref_counted.h"
-#include "content/public/renderer/render_view_observer.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"
@@ -17,34 +16,37 @@ class RenderView;
class RenderViewImpl;
class MockScreenOrientationController
mlamouri (slow - plz ping) 2014/06/18 13:47:42 Can you call this MockScreenOrientationClient?
- : public base::RefCountedThreadSafe<MockScreenOrientationController>,
- public RenderViewObserver {
+ : public blink::WebScreenOrientationClient {
public:
- MockScreenOrientationController();
+ explicit MockScreenOrientationController();
+ virtual ~MockScreenOrientationController();
void ResetData();
void UpdateDeviceOrientation(RenderView* render_view,
blink::WebScreenOrientationType);
private:
- virtual ~MockScreenOrientationController();
+ // 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);
- RenderViewImpl* render_view_impl() const;
-
- // RenderViewObserver
- virtual void OnDestruct() OVERRIDE;
+ blink::WebScreenOrientationType SuitableOrientationForCurrentLock();
+ RenderView* render_view_;
blink::WebScreenOrientationLockType current_lock_;
blink::WebScreenOrientationType device_orientation_;
blink::WebScreenOrientationType current_orientation_;
DISALLOW_COPY_AND_ASSIGN(MockScreenOrientationController);
- friend class base::LazyInstance<MockScreenOrientationController>;
- friend class base::RefCountedThreadSafe<MockScreenOrientationController>;
};
-} // namespace content
+} // namespace content
-#endif // CONTENT_RENDERER_SCREEN_ORIENTATION_MOCK_SCREEN_ORIENTATION_CONTROLLER_H_
+#endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_MOCK_SCREEN_ORIENTATION_CONTROLLER_H_

Powered by Google App Engine
This is Rietveld 408576698