OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
542 } | 542 } |
543 | 543 |
544 void ContentViewCoreImpl::DidStartLoading() { | 544 void ContentViewCoreImpl::DidStartLoading() { |
545 JNIEnv* env = AttachCurrentThread(); | 545 JNIEnv* env = AttachCurrentThread(); |
546 ScopedJavaLocalRef<jobject> j_obj = java_ref_.get(env); | 546 ScopedJavaLocalRef<jobject> j_obj = java_ref_.get(env); |
547 if (j_obj.is_null()) | 547 if (j_obj.is_null()) |
548 return; | 548 return; |
549 Java_ContentViewCore_didStartLoading(env, j_obj.obj()); | 549 Java_ContentViewCore_didStartLoading(env, j_obj.obj()); |
550 } | 550 } |
551 | 551 |
552 void ContentViewCoreImpl::OnAcceleratedCompositingStateChange( | |
553 RenderWidgetHostViewAndroid* rwhva, bool activated, bool force) { | |
554 NOTIMPLEMENTED() << "not upstreamed yet"; | |
555 } | |
556 | |
557 void ContentViewCoreImpl::StartContentIntent(const GURL& content_url) { | 552 void ContentViewCoreImpl::StartContentIntent(const GURL& content_url) { |
558 JNIEnv* env = AttachCurrentThread(); | 553 JNIEnv* env = AttachCurrentThread(); |
559 ScopedJavaLocalRef<jobject> j_obj = java_ref_.get(env); | 554 ScopedJavaLocalRef<jobject> j_obj = java_ref_.get(env); |
560 if (j_obj.is_null()) | 555 if (j_obj.is_null()) |
561 return; | 556 return; |
562 ScopedJavaLocalRef<jstring> jcontent_url = | 557 ScopedJavaLocalRef<jstring> jcontent_url = |
563 ConvertUTF8ToJavaString(env, content_url.spec()); | 558 ConvertUTF8ToJavaString(env, content_url.spec()); |
564 Java_ContentViewCore_startContentIntent(env, | 559 Java_ContentViewCore_startContentIntent(env, |
565 j_obj.obj(), | 560 j_obj.obj(), |
566 jcontent_url.obj()); | 561 jcontent_url.obj()); |
(...skipping 19 matching lines...) Expand all Loading... |
586 if (!HasField(env, clazz, "mNativeContentViewCore", "I")) { | 581 if (!HasField(env, clazz, "mNativeContentViewCore", "I")) { |
587 DLOG(ERROR) << "Unable to find ContentView.mNativeContentViewCore!"; | 582 DLOG(ERROR) << "Unable to find ContentView.mNativeContentViewCore!"; |
588 return false; | 583 return false; |
589 } | 584 } |
590 g_native_content_view = GetFieldID(env, clazz, "mNativeContentViewCore", "I"); | 585 g_native_content_view = GetFieldID(env, clazz, "mNativeContentViewCore", "I"); |
591 | 586 |
592 return RegisterNativesImpl(env) >= 0; | 587 return RegisterNativesImpl(env) >= 0; |
593 } | 588 } |
594 | 589 |
595 } // namespace content | 590 } // namespace content |
OLD | NEW |