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

Unified Diff: content/renderer/screen_orientation/mock_screen_orientation_controller.cc

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 side-by-side diff with in-line comments
Download patch
Index: content/renderer/screen_orientation/mock_screen_orientation_controller.cc
diff --git a/content/renderer/screen_orientation/mock_screen_orientation_controller.cc b/content/renderer/screen_orientation/mock_screen_orientation_controller.cc
index f0b1a6df4e5e3aead135ead6b4870b10cf85a06e..bbff907dda565e8793d8b3539f8bbe4f78feb353 100644
--- a/content/renderer/screen_orientation/mock_screen_orientation_controller.cc
+++ b/content/renderer/screen_orientation/mock_screen_orientation_controller.cc
@@ -7,14 +7,12 @@
#include "base/bind.h"
#include "base/logging.h"
#include "base/message_loop/message_loop.h"
-#include "content/renderer/render_view_impl.h"
#include "third_party/WebKit/public/platform/WebScreenOrientationListener.h"
namespace content {
MockScreenOrientationController::MockScreenOrientationController()
- : RenderViewObserver(NULL),
- current_lock_(blink::WebScreenOrientationLockDefault),
+ : current_lock_(blink::WebScreenOrientationLockDefault),
device_orientation_(blink::WebScreenOrientationPortraitPrimary),
current_orientation_(blink::WebScreenOrientationPortraitPrimary),
listener_(NULL) {
@@ -32,9 +30,6 @@
}
void MockScreenOrientationController::ResetData() {
- if (render_view_impl())
- render_view_impl()->RemoveObserver(this);
-
current_lock_ = blink::WebScreenOrientationLockDefault;
device_orientation_ = blink::WebScreenOrientationPortraitPrimary;
current_orientation_ = blink::WebScreenOrientationPortraitPrimary;
@@ -69,15 +64,7 @@
}
void MockScreenOrientationController::UpdateDeviceOrientation(
- RenderView* render_view,
blink::WebScreenOrientationType orientation) {
- if (this->render_view()) {
- // Make sure that render_view_ did not change during test.
- DCHECK_EQ(this->render_view(), render_view);
- } else {
- Observe(render_view);
- }
-
if (device_orientation_ == orientation)
return;
device_orientation_ = orientation;
@@ -86,18 +73,11 @@
UpdateScreenOrientation(orientation);
}
-RenderViewImpl* MockScreenOrientationController::render_view_impl() const {
- return static_cast<RenderViewImpl*>(render_view());
-}
-
void MockScreenOrientationController::UpdateScreenOrientation(
blink::WebScreenOrientationType orientation) {
if (current_orientation_ == orientation)
return;
current_orientation_ = orientation;
- if (render_view_impl())
- render_view_impl()->SetScreenOrientationForTesting(orientation);
-
if (listener_)
listener_->didChangeScreenOrientation(current_orientation_);
}
@@ -144,7 +124,4 @@
}
}
-void MockScreenOrientationController::OnDestruct() {
-}
-
} // namespace content
« no previous file with comments | « content/renderer/screen_orientation/mock_screen_orientation_controller.h ('k') | content/test/layouttest_support.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698