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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/android/jni_android.h" | 9 #include "base/android/jni_android.h" |
10 #include "base/android/jni_array.h" | 10 #include "base/android/jni_array.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 #include "content/browser/renderer_host/render_widget_host_view_android.h" | 34 #include "content/browser/renderer_host/render_widget_host_view_android.h" |
35 #include "content/browser/web_contents/web_contents_view_android.h" | 35 #include "content/browser/web_contents/web_contents_view_android.h" |
36 #include "content/common/frame_messages.h" | 36 #include "content/common/frame_messages.h" |
37 #include "content/common/input_messages.h" | 37 #include "content/common/input_messages.h" |
38 #include "content/common/view_messages.h" | 38 #include "content/common/view_messages.h" |
39 #include "content/public/browser/android/compositor.h" | 39 #include "content/public/browser/android/compositor.h" |
40 #include "content/public/browser/browser_context.h" | 40 #include "content/public/browser/browser_context.h" |
41 #include "content/public/browser/browser_thread.h" | 41 #include "content/public/browser/browser_thread.h" |
42 #include "content/public/browser/favicon_status.h" | 42 #include "content/public/browser/favicon_status.h" |
43 #include "content/public/browser/render_frame_host.h" | 43 #include "content/public/browser/render_frame_host.h" |
| 44 #include "content/public/browser/render_view_host.h" |
44 #include "content/public/browser/screen_orientation_provider.h" | 45 #include "content/public/browser/screen_orientation_provider.h" |
45 #include "content/public/browser/ssl_host_state_delegate.h" | 46 #include "content/public/browser/ssl_host_state_delegate.h" |
46 #include "content/public/browser/web_contents.h" | 47 #include "content/public/browser/web_contents.h" |
47 #include "content/public/common/content_client.h" | 48 #include "content/public/common/content_client.h" |
48 #include "content/public/common/content_switches.h" | 49 #include "content/public/common/content_switches.h" |
49 #include "content/public/common/menu_item.h" | 50 #include "content/public/common/menu_item.h" |
50 #include "content/public/common/user_agent.h" | 51 #include "content/public/common/user_agent.h" |
51 #include "device/geolocation/geolocation_service_context.h" | 52 #include "device/geolocation/geolocation_service_context.h" |
52 #include "jni/ContentViewCore_jni.h" | 53 #include "jni/ContentViewCore_jni.h" |
53 #include "jni/DragEvent_jni.h" | 54 #include "jni/DragEvent_jni.h" |
(...skipping 1338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1392 jint width, | 1393 jint width, |
1393 jint height) { | 1394 jint height) { |
1394 gfx::Rect rect( | 1395 gfx::Rect rect( |
1395 static_cast<int>(x / dpi_scale()), | 1396 static_cast<int>(x / dpi_scale()), |
1396 static_cast<int>(y / dpi_scale()), | 1397 static_cast<int>(y / dpi_scale()), |
1397 static_cast<int>((width > 0 && width < dpi_scale()) ? | 1398 static_cast<int>((width > 0 && width < dpi_scale()) ? |
1398 1 : (int)(width / dpi_scale())), | 1399 1 : (int)(width / dpi_scale())), |
1399 static_cast<int>((height > 0 && height < dpi_scale()) ? | 1400 static_cast<int>((height > 0 && height < dpi_scale()) ? |
1400 1 : (int)(height / dpi_scale()))); | 1401 1 : (int)(height / dpi_scale()))); |
1401 GetWebContents()->Send(new ViewMsg_ExtractSmartClipData( | 1402 GetWebContents()->Send(new ViewMsg_ExtractSmartClipData( |
1402 GetWebContents()->GetRoutingID(), rect)); | 1403 GetWebContents()->GetRenderViewHost()->GetRoutingID(), rect)); |
1403 } | 1404 } |
1404 | 1405 |
1405 jint ContentViewCoreImpl::GetCurrentRenderProcessId( | 1406 jint ContentViewCoreImpl::GetCurrentRenderProcessId( |
1406 JNIEnv* env, | 1407 JNIEnv* env, |
1407 const JavaParamRef<jobject>& obj) { | 1408 const JavaParamRef<jobject>& obj) { |
1408 return GetRenderProcessIdFromRenderViewHost( | 1409 return GetRenderProcessIdFromRenderViewHost( |
1409 web_contents_->GetRenderViewHost()); | 1410 web_contents_->GetRenderViewHost()); |
1410 } | 1411 } |
1411 | 1412 |
1412 void ContentViewCoreImpl::SetBackgroundOpaque(JNIEnv* env, | 1413 void ContentViewCoreImpl::SetBackgroundOpaque(JNIEnv* env, |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1598 return ScopedJavaLocalRef<jobject>(); | 1599 return ScopedJavaLocalRef<jobject>(); |
1599 | 1600 |
1600 return view->GetJavaObject(); | 1601 return view->GetJavaObject(); |
1601 } | 1602 } |
1602 | 1603 |
1603 bool RegisterContentViewCore(JNIEnv* env) { | 1604 bool RegisterContentViewCore(JNIEnv* env) { |
1604 return RegisterNativesImpl(env); | 1605 return RegisterNativesImpl(env); |
1605 } | 1606 } |
1606 | 1607 |
1607 } // namespace content | 1608 } // namespace content |
OLD | NEW |