diff options
author | tkent@chromium.org <tkent@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-16 01:31:42 +0000 |
---|---|---|
committer | tkent@chromium.org <tkent@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-16 01:31:42 +0000 |
commit | 6f71d7a54374d731ba4f51c07b787340250ec050 (patch) | |
tree | 9d8fcb987348c3ae9651518cfc71aba4f7cd6845 /content/browser/android | |
parent | 9c9d0b83d2d9d46538f4cf7d3c8b1dabe14401fb (diff) | |
download | chromium_src-6f71d7a54374d731ba4f51c07b787340250ec050.zip chromium_src-6f71d7a54374d731ba4f51c07b787340250ec050.tar.gz chromium_src-6f71d7a54374d731ba4f51c07b787340250ec050.tar.bz2 |
Revert of Properly route screen orientation IPC messages. (https://codereview.chromium.org/327573002/)
Reason for revert:
Broke screen_orientation/lockOrientation-sandboxed-iframe.html
http://test-results.appspot.com/dashboards/flakiness_dashboard.html#group=%40ToT%20Blink&tests=screen_orientation/lockOrientation-sandboxed-iframe.html
Original issue's description:
> Properly route screen orientation IPC messages.
>
> The messages will now go trough RF/RFH.
> This is in order to make screen orientation lock Frame specific
> instead of global to Chromium. The next step is to change the provider
> accordingly.
>
> BUG=162827
>
> Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=277321
TBR=dcheng@chromium.org,jam@chromium.org,mlamouri@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=162827
Review URL: https://codereview.chromium.org/336153002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@277346 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/android')
-rw-r--r-- | content/browser/android/content_view_core_impl.cc | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/content/browser/android/content_view_core_impl.cc b/content/browser/android/content_view_core_impl.cc index 2335d0a..0fdc058 100644 --- a/content/browser/android/content_view_core_impl.cc +++ b/content/browser/android/content_view_core_impl.cc @@ -1542,6 +1542,38 @@ void ContentViewCoreImpl::SendOrientationChangeEventInternal() { RenderWidgetHostViewAndroid* rwhv = GetRenderWidgetHostViewAndroid(); if (rwhv) rwhv->UpdateScreenInfo(GetViewAndroid()); + + // TODO(mlamouri): temporary plumbing for Screen Orientation, this will change + // in the future. The OnResize IPC message sent from UpdateScreenInfo() will + // propagate the information. + blink::WebScreenOrientationType orientation = + blink::WebScreenOrientationPortraitPrimary; + + switch (device_orientation_) { + case 0: + orientation = blink::WebScreenOrientationPortraitPrimary; + break; + case 90: + orientation = blink::WebScreenOrientationLandscapePrimary; + break; + case -90: + orientation = blink::WebScreenOrientationLandscapeSecondary; + break; + case 180: + orientation = blink::WebScreenOrientationPortraitSecondary; + break; + default: + NOTREACHED(); + } + + ScreenOrientationDispatcherHost* sodh = + static_cast<RenderProcessHostImpl*>(web_contents_-> + GetRenderProcessHost())->screen_orientation_dispatcher_host(); + + // sodh can be null if the RenderProcessHost is in the process of being + // destroyed or not yet initialized. + if (sodh) + sodh->OnOrientationChange(orientation); } void ContentViewCoreImpl::ExtractSmartClipData(JNIEnv* env, |