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 19 matching lines...) Expand all Loading... |
30 #include "content/browser/renderer_host/input/web_input_event_builders_android.h
" | 30 #include "content/browser/renderer_host/input/web_input_event_builders_android.h
" |
31 #include "content/browser/renderer_host/input/web_input_event_util.h" | 31 #include "content/browser/renderer_host/input/web_input_event_util.h" |
32 #include "content/browser/renderer_host/render_view_host_impl.h" | 32 #include "content/browser/renderer_host/render_view_host_impl.h" |
33 #include "content/browser/renderer_host/render_widget_host_impl.h" | 33 #include "content/browser/renderer_host/render_widget_host_impl.h" |
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/web_input_event_traits.h" | 37 #include "content/common/input/web_input_event_traits.h" |
38 #include "content/common/input_messages.h" | 38 #include "content/common/input_messages.h" |
39 #include "content/common/view_messages.h" | 39 #include "content/common/view_messages.h" |
| 40 #include "content/public/browser/android/compositor.h" |
40 #include "content/public/browser/browser_context.h" | 41 #include "content/public/browser/browser_context.h" |
41 #include "content/public/browser/browser_thread.h" | 42 #include "content/public/browser/browser_thread.h" |
42 #include "content/public/browser/favicon_status.h" | 43 #include "content/public/browser/favicon_status.h" |
43 #include "content/public/browser/render_frame_host.h" | 44 #include "content/public/browser/render_frame_host.h" |
44 #include "content/public/browser/screen_orientation_dispatcher_host.h" | 45 #include "content/public/browser/screen_orientation_dispatcher_host.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" |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 ContentViewCoreImpl::ContentViewCoreImpl( | 214 ContentViewCoreImpl::ContentViewCoreImpl( |
214 JNIEnv* env, | 215 JNIEnv* env, |
215 jobject obj, | 216 jobject obj, |
216 WebContents* web_contents, | 217 WebContents* web_contents, |
217 jobject view_android_delegate, | 218 jobject view_android_delegate, |
218 ui::WindowAndroid* window_android, | 219 ui::WindowAndroid* window_android, |
219 jobject java_bridge_retained_object_set) | 220 jobject java_bridge_retained_object_set) |
220 : WebContentsObserver(web_contents), | 221 : WebContentsObserver(web_contents), |
221 java_ref_(env, obj), | 222 java_ref_(env, obj), |
222 web_contents_(static_cast<WebContentsImpl*>(web_contents)), | 223 web_contents_(static_cast<WebContentsImpl*>(web_contents)), |
223 root_layer_(cc::SolidColorLayer::Create()), | 224 root_layer_(cc::SolidColorLayer::Create(Compositor::LayerSettings())), |
224 dpi_scale_(GetPrimaryDisplayDeviceScaleFactor()), | 225 dpi_scale_(GetPrimaryDisplayDeviceScaleFactor()), |
225 view_android_(new ui::ViewAndroid(view_android_delegate, window_android)), | 226 view_android_(new ui::ViewAndroid(view_android_delegate, window_android)), |
226 window_android_(window_android), | 227 window_android_(window_android), |
227 device_orientation_(0), | 228 device_orientation_(0), |
228 accessibility_enabled_(false) { | 229 accessibility_enabled_(false) { |
229 CHECK(web_contents) << | 230 CHECK(web_contents) << |
230 "A ContentViewCoreImpl should be created with a valid WebContents."; | 231 "A ContentViewCoreImpl should be created with a valid WebContents."; |
231 DCHECK(window_android_); | 232 DCHECK(window_android_); |
232 | 233 |
233 root_layer_->SetBackgroundColor(GetBackgroundColor(env, obj)); | 234 root_layer_->SetBackgroundColor(GetBackgroundColor(env, obj)); |
(...skipping 1227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1461 return NULL; | 1462 return NULL; |
1462 | 1463 |
1463 return view->GetJavaObject().Release(); | 1464 return view->GetJavaObject().Release(); |
1464 } | 1465 } |
1465 | 1466 |
1466 bool RegisterContentViewCore(JNIEnv* env) { | 1467 bool RegisterContentViewCore(JNIEnv* env) { |
1467 return RegisterNativesImpl(env); | 1468 return RegisterNativesImpl(env); |
1468 } | 1469 } |
1469 | 1470 |
1470 } // namespace content | 1471 } // namespace content |
OLD | NEW |