Commit ed9f6c1c authored by dcheng's avatar dcheng Committed by Commit bot

Fix orientation change callbacks to go through WebLocalFrame.

Remote frames can't script, so it never makes sense to dispatch
orientation change events at remote frames. Also cleans up some method
declarations to have named parameters, to match Chromium style.

BUG=416658

Review URL: https://codereview.chromium.org/596623002

Cr-Commit-Position: refs/heads/master@{#296148}
parent 79808322
......@@ -3128,7 +3128,7 @@ void RenderViewImpl::OnOrientationChange() {
observers_,
OrientationChangeEvent());
webview()->mainFrame()->sendOrientationChangeEvent();
webview()->mainFrame()->toWebLocalFrame()->sendOrientationChangeEvent();
}
void RenderViewImpl::OnPluginActionAt(const gfx::Point& location,
......
......@@ -7,7 +7,7 @@
#include "base/bind.h"
#include "base/logging.h"
#include "base/message_loop/message_loop.h"
#include "third_party/WebKit/public/web/WebFrame.h"
#include "third_party/WebKit/public/web/WebLocalFrame.h"
namespace content {
......@@ -28,7 +28,7 @@ void MockScreenOrientationClient::ResetData() {
}
void MockScreenOrientationClient::UpdateDeviceOrientation(
blink::WebFrame* main_frame,
blink::WebLocalFrame* main_frame,
blink::WebScreenOrientationType orientation) {
main_frame_ = main_frame;
if (device_orientation_ == orientation)
......
......@@ -12,7 +12,7 @@
#include "third_party/WebKit/public/platform/WebScreenOrientationType.h"
namespace blink {
class WebFrame;
class WebLocalFrame;
}
namespace content {
......@@ -23,16 +23,16 @@ class MockScreenOrientationClient : public blink::WebScreenOrientationClient {
virtual ~MockScreenOrientationClient();
void ResetData();
void UpdateDeviceOrientation(blink::WebFrame*,
blink::WebScreenOrientationType);
void UpdateDeviceOrientation(blink::WebLocalFrame* main_frame,
blink::WebScreenOrientationType orientation);
blink::WebScreenOrientationType CurrentOrientationType() const;
unsigned CurrentOrientationAngle() const;
private:
// From blink::WebScreenOrientationClient.
virtual void lockOrientation(blink::WebScreenOrientationLockType,
blink::WebLockOrientationCallback*);
virtual void lockOrientation(blink::WebScreenOrientationLockType orientation,
blink::WebLockOrientationCallback* callback);
virtual void unlockOrientation();
void UpdateLockSync(blink::WebScreenOrientationLockType,
......@@ -44,7 +44,7 @@ class MockScreenOrientationClient : public blink::WebScreenOrientationClient {
blink::WebScreenOrientationType SuitableOrientationForCurrentLock();
static unsigned OrientationTypeToAngle(blink::WebScreenOrientationType);
blink::WebFrame* main_frame_;
blink::WebLocalFrame* main_frame_;
blink::WebScreenOrientationLockType current_lock_;
blink::WebScreenOrientationType device_orientation_;
blink::WebScreenOrientationType current_orientation_;
......
......@@ -225,8 +225,8 @@ void WebKitTestRunner::SetScreenOrientation(
const WebScreenOrientationType& orientation) {
MockScreenOrientationClient* mock_client =
proxy()->GetScreenOrientationClientMock();
mock_client->UpdateDeviceOrientation(render_view()->GetWebView()->mainFrame(),
orientation);
mock_client->UpdateDeviceOrientation(
render_view()->GetWebView()->mainFrame()->toWebLocalFrame(), orientation);
}
void WebKitTestRunner::ResetScreenOrientation() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment