Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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" | |
| 33 #include "content/browser/ssl/ssl_host_state.h" | 34 #include "content/browser/ssl/ssl_host_state.h" |
| 34 #include "content/browser/web_contents/web_contents_view_android.h" | 35 #include "content/browser/web_contents/web_contents_view_android.h" |
| 35 #include "content/common/input/web_input_event_traits.h" | 36 #include "content/common/input/web_input_event_traits.h" |
| 36 #include "content/common/input_messages.h" | 37 #include "content/common/input_messages.h" |
| 37 #include "content/common/view_messages.h" | 38 #include "content/common/view_messages.h" |
| 38 #include "content/public/browser/android/external_video_surface_container.h" | 39 #include "content/public/browser/android/external_video_surface_container.h" |
| 39 #include "content/public/browser/browser_accessibility_state.h" | 40 #include "content/public/browser/browser_accessibility_state.h" |
| 40 #include "content/public/browser/browser_context.h" | 41 #include "content/public/browser/browser_context.h" |
| 41 #include "content/public/browser/favicon_status.h" | 42 #include "content/public/browser/favicon_status.h" |
| 42 #include "content/public/browser/notification_details.h" | 43 #include "content/public/browser/notification_details.h" |
| (...skipping 1731 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1774 } | 1775 } |
| 1775 | 1776 |
| 1776 void ContentViewCoreImpl::SendOrientationChangeEventInternal() { | 1777 void ContentViewCoreImpl::SendOrientationChangeEventInternal() { |
| 1777 RenderWidgetHostViewAndroid* rwhv = GetRenderWidgetHostViewAndroid(); | 1778 RenderWidgetHostViewAndroid* rwhv = GetRenderWidgetHostViewAndroid(); |
| 1778 if (rwhv) | 1779 if (rwhv) |
| 1779 rwhv->UpdateScreenInfo(rwhv->GetNativeView()); | 1780 rwhv->UpdateScreenInfo(rwhv->GetNativeView()); |
| 1780 | 1781 |
| 1781 RenderViewHostImpl* rvhi = static_cast<RenderViewHostImpl*>( | 1782 RenderViewHostImpl* rvhi = static_cast<RenderViewHostImpl*>( |
| 1782 web_contents_->GetRenderViewHost()); | 1783 web_contents_->GetRenderViewHost()); |
| 1783 rvhi->SendOrientationChangeEvent(device_orientation_); | 1784 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; | |
|
jochen (gone - plz use gerrit)
2014/02/24 14:08:26
default: NOTREACHED()?
mlamouri (slow - plz ping)
2014/02/24 14:20:21
Done.
| |
| 1805 } | |
| 1806 | |
| 1807 static_cast<RenderProcessHostImpl*>(web_contents_->GetRenderProcessHost())-> | |
| 1808 screen_orientation_dispatcher_host()-> | |
| 1809 OnOrientationChange(orientation); | |
| 1784 } | 1810 } |
| 1785 | 1811 |
| 1786 void ContentViewCoreImpl::ExtractSmartClipData(JNIEnv* env, | 1812 void ContentViewCoreImpl::ExtractSmartClipData(JNIEnv* env, |
| 1787 jobject obj, | 1813 jobject obj, |
| 1788 jint x, | 1814 jint x, |
| 1789 jint y, | 1815 jint y, |
| 1790 jint width, | 1816 jint width, |
| 1791 jint height) { | 1817 jint height) { |
| 1792 gfx::Rect rect( | 1818 gfx::Rect rect( |
| 1793 static_cast<int>(x / GetDpiScale()), | 1819 static_cast<int>(x / GetDpiScale()), |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1830 reinterpret_cast<ui::ViewAndroid*>(view_android), | 1856 reinterpret_cast<ui::ViewAndroid*>(view_android), |
| 1831 reinterpret_cast<ui::WindowAndroid*>(window_android)); | 1857 reinterpret_cast<ui::WindowAndroid*>(window_android)); |
| 1832 return reinterpret_cast<intptr_t>(view); | 1858 return reinterpret_cast<intptr_t>(view); |
| 1833 } | 1859 } |
| 1834 | 1860 |
| 1835 bool RegisterContentViewCore(JNIEnv* env) { | 1861 bool RegisterContentViewCore(JNIEnv* env) { |
| 1836 return RegisterNativesImpl(env); | 1862 return RegisterNativesImpl(env); |
| 1837 } | 1863 } |
| 1838 | 1864 |
| 1839 } // namespace content | 1865 } // namespace content |
| OLD | NEW |