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" |
11 #include "base/android/jni_string.h" | 11 #include "base/android/jni_string.h" |
12 #include "base/android/scoped_java_ref.h" | 12 #include "base/android/scoped_java_ref.h" |
13 #include "base/command_line.h" | 13 #include "base/command_line.h" |
14 #include "base/logging.h" | 14 #include "base/logging.h" |
15 #include "base/macros.h" | 15 #include "base/macros.h" |
| 16 #include "base/memory/ptr_util.h" |
16 #include "base/metrics/histogram_macros.h" | 17 #include "base/metrics/histogram_macros.h" |
17 #include "base/metrics/user_metrics.h" | 18 #include "base/metrics/user_metrics.h" |
18 #include "base/strings/string_util.h" | 19 #include "base/strings/string_util.h" |
19 #include "base/values.h" | 20 #include "base/values.h" |
20 #include "cc/layers/layer.h" | 21 #include "cc/layers/layer.h" |
21 #include "cc/layers/solid_color_layer.h" | 22 #include "cc/layers/solid_color_layer.h" |
22 #include "cc/output/begin_frame_args.h" | 23 #include "cc/output/begin_frame_args.h" |
23 #include "content/browser/accessibility/browser_accessibility_manager_android.h" | 24 #include "content/browser/accessibility/browser_accessibility_manager_android.h" |
24 #include "content/browser/accessibility/browser_accessibility_state_impl.h" | 25 #include "content/browser/accessibility/browser_accessibility_state_impl.h" |
25 #include "content/browser/android/gesture_event_type.h" | 26 #include "content/browser/android/gesture_event_type.h" |
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 SetContentViewCore(NULL); | 319 SetContentViewCore(NULL); |
319 } | 320 } |
320 | 321 |
321 void ContentViewCoreImpl::InitWebContents() { | 322 void ContentViewCoreImpl::InitWebContents() { |
322 DCHECK(web_contents_); | 323 DCHECK(web_contents_); |
323 static_cast<WebContentsViewAndroid*>( | 324 static_cast<WebContentsViewAndroid*>( |
324 static_cast<WebContentsImpl*>(web_contents_)->GetView())-> | 325 static_cast<WebContentsImpl*>(web_contents_)->GetView())-> |
325 SetContentViewCore(this); | 326 SetContentViewCore(this); |
326 DCHECK(!web_contents_->GetUserData(kContentViewUserDataKey)); | 327 DCHECK(!web_contents_->GetUserData(kContentViewUserDataKey)); |
327 web_contents_->SetUserData(kContentViewUserDataKey, | 328 web_contents_->SetUserData(kContentViewUserDataKey, |
328 new ContentViewUserData(this)); | 329 base::MakeUnique<ContentViewUserData>(this)); |
329 } | 330 } |
330 | 331 |
331 void ContentViewCoreImpl::RenderViewReady() { | 332 void ContentViewCoreImpl::RenderViewReady() { |
332 JNIEnv* env = AttachCurrentThread(); | 333 JNIEnv* env = AttachCurrentThread(); |
333 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); | 334 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
334 if (!obj.is_null()) | 335 if (!obj.is_null()) |
335 Java_ContentViewCore_onRenderProcessChange(env, obj); | 336 Java_ContentViewCore_onRenderProcessChange(env, obj); |
336 | 337 |
337 if (device_orientation_ != 0) | 338 if (device_orientation_ != 0) |
338 SendOrientationChangeEventInternal(); | 339 SendOrientationChangeEventInternal(); |
(...skipping 936 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1275 return ScopedJavaLocalRef<jobject>(); | 1276 return ScopedJavaLocalRef<jobject>(); |
1276 | 1277 |
1277 return view->GetJavaObject(); | 1278 return view->GetJavaObject(); |
1278 } | 1279 } |
1279 | 1280 |
1280 bool RegisterContentViewCore(JNIEnv* env) { | 1281 bool RegisterContentViewCore(JNIEnv* env) { |
1281 return RegisterNativesImpl(env); | 1282 return RegisterNativesImpl(env); |
1282 } | 1283 } |
1283 | 1284 |
1284 } // namespace content | 1285 } // namespace content |
OLD | NEW |