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

Side by Side Diff: content/browser/android/content_view_core_impl.cc

Issue 177293003: Revert of Chromium plumbing for Screen Orientation API orientationchange events. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 9 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 unified diff | Download patch
« no previous file with comments | « content/browser/DEPS ('k') | content/browser/renderer_host/render_process_host_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/android/content_view_core_impl.h" 5 #include "content/browser/android/content_view_core_impl.h"
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "base/android/jni_array.h" 8 #include "base/android/jni_array.h"
9 #include "base/android/jni_string.h" 9 #include "base/android/jni_string.h"
10 #include "base/android/scoped_java_ref.h" 10 #include "base/android/scoped_java_ref.h"
(...skipping 12 matching lines...) Expand all
23 #include "content/browser/frame_host/navigation_controller_impl.h" 23 #include "content/browser/frame_host/navigation_controller_impl.h"
24 #include "content/browser/frame_host/navigation_entry_impl.h" 24 #include "content/browser/frame_host/navigation_entry_impl.h"
25 #include "content/browser/media/android/browser_media_player_manager.h" 25 #include "content/browser/media/android/browser_media_player_manager.h"
26 #include "content/browser/renderer_host/compositor_impl_android.h" 26 #include "content/browser/renderer_host/compositor_impl_android.h"
27 #include "content/browser/renderer_host/input/web_input_event_builders_android.h " 27 #include "content/browser/renderer_host/input/web_input_event_builders_android.h "
28 #include "content/browser/renderer_host/java/java_bound_object.h" 28 #include "content/browser/renderer_host/java/java_bound_object.h"
29 #include "content/browser/renderer_host/java/java_bridge_dispatcher_host_manager .h" 29 #include "content/browser/renderer_host/java/java_bridge_dispatcher_host_manager .h"
30 #include "content/browser/renderer_host/render_view_host_impl.h" 30 #include "content/browser/renderer_host/render_view_host_impl.h"
31 #include "content/browser/renderer_host/render_widget_host_impl.h" 31 #include "content/browser/renderer_host/render_widget_host_impl.h"
32 #include "content/browser/renderer_host/render_widget_host_view_android.h" 32 #include "content/browser/renderer_host/render_widget_host_view_android.h"
33 #include "content/browser/screen_orientation/screen_orientation_dispatcher_host. h"
34 #include "content/browser/ssl/ssl_host_state.h" 33 #include "content/browser/ssl/ssl_host_state.h"
35 #include "content/browser/web_contents/web_contents_view_android.h" 34 #include "content/browser/web_contents/web_contents_view_android.h"
36 #include "content/common/input/web_input_event_traits.h" 35 #include "content/common/input/web_input_event_traits.h"
37 #include "content/common/input_messages.h" 36 #include "content/common/input_messages.h"
38 #include "content/common/view_messages.h" 37 #include "content/common/view_messages.h"
39 #include "content/public/browser/android/external_video_surface_container.h" 38 #include "content/public/browser/android/external_video_surface_container.h"
40 #include "content/public/browser/browser_accessibility_state.h" 39 #include "content/public/browser/browser_accessibility_state.h"
41 #include "content/public/browser/browser_context.h" 40 #include "content/public/browser/browser_context.h"
42 #include "content/public/browser/favicon_status.h" 41 #include "content/public/browser/favicon_status.h"
43 #include "content/public/browser/notification_details.h" 42 #include "content/public/browser/notification_details.h"
(...skipping 1731 matching lines...) Expand 10 before | Expand all | Expand 10 after
1775 } 1774 }
1776 1775
1777 void ContentViewCoreImpl::SendOrientationChangeEventInternal() { 1776 void ContentViewCoreImpl::SendOrientationChangeEventInternal() {
1778 RenderWidgetHostViewAndroid* rwhv = GetRenderWidgetHostViewAndroid(); 1777 RenderWidgetHostViewAndroid* rwhv = GetRenderWidgetHostViewAndroid();
1779 if (rwhv) 1778 if (rwhv)
1780 rwhv->UpdateScreenInfo(rwhv->GetNativeView()); 1779 rwhv->UpdateScreenInfo(rwhv->GetNativeView());
1781 1780
1782 RenderViewHostImpl* rvhi = static_cast<RenderViewHostImpl*>( 1781 RenderViewHostImpl* rvhi = static_cast<RenderViewHostImpl*>(
1783 web_contents_->GetRenderViewHost()); 1782 web_contents_->GetRenderViewHost());
1784 rvhi->SendOrientationChangeEvent(device_orientation_); 1783 rvhi->SendOrientationChangeEvent(device_orientation_);
1785
1786 // TODO(mlamouri): temporary plumbing for Screen Orientation, this will change
1787 // in the future. It might leave ContentViewCoreImpl or simply replace the
1788 // SendOrientationChangeEvent call above.
1789 blink::WebScreenOrientation orientation =
1790 blink::WebScreenOrientationPortraitPrimary;
1791
1792 switch (device_orientation_) {
1793 case 0:
1794 orientation = blink::WebScreenOrientationPortraitPrimary;
1795 break;
1796 case 90:
1797 orientation = blink::WebScreenOrientationLandscapePrimary;
1798 break;
1799 case -90:
1800 orientation = blink::WebScreenOrientationLandscapeSecondary;
1801 break;
1802 case 180:
1803 orientation = blink::WebScreenOrientationPortraitSecondary;
1804 break;
1805 default:
1806 NOTREACHED();
1807 }
1808
1809 static_cast<RenderProcessHostImpl*>(web_contents_->GetRenderProcessHost())->
1810 screen_orientation_dispatcher_host()->
1811 OnOrientationChange(orientation);
1812 } 1784 }
1813 1785
1814 void ContentViewCoreImpl::ExtractSmartClipData(JNIEnv* env, 1786 void ContentViewCoreImpl::ExtractSmartClipData(JNIEnv* env,
1815 jobject obj, 1787 jobject obj,
1816 jint x, 1788 jint x,
1817 jint y, 1789 jint y,
1818 jint width, 1790 jint width,
1819 jint height) { 1791 jint height) {
1820 gfx::Rect rect( 1792 gfx::Rect rect(
1821 static_cast<int>(x / GetDpiScale()), 1793 static_cast<int>(x / GetDpiScale()),
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
1858 reinterpret_cast<ui::ViewAndroid*>(view_android), 1830 reinterpret_cast<ui::ViewAndroid*>(view_android),
1859 reinterpret_cast<ui::WindowAndroid*>(window_android)); 1831 reinterpret_cast<ui::WindowAndroid*>(window_android));
1860 return reinterpret_cast<intptr_t>(view); 1832 return reinterpret_cast<intptr_t>(view);
1861 } 1833 }
1862 1834
1863 bool RegisterContentViewCore(JNIEnv* env) { 1835 bool RegisterContentViewCore(JNIEnv* env) {
1864 return RegisterNativesImpl(env); 1836 return RegisterNativesImpl(env);
1865 } 1837 }
1866 1838
1867 } // namespace content 1839 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/DEPS ('k') | content/browser/renderer_host/render_process_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698