| 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 "components/web_contents_delegate_android/web_contents_delegate_android
.h" | 5 #include "components/web_contents_delegate_android/web_contents_delegate_android
.h" |
| 6 | 6 |
| 7 #include <android/keycodes.h> | 7 #include <android/keycodes.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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 JNIEnv* env = AttachCurrentThread(); | 119 JNIEnv* env = AttachCurrentThread(); |
| 120 ScopedJavaLocalRef<jobject> obj = GetJavaDelegate(env); | 120 ScopedJavaLocalRef<jobject> obj = GetJavaDelegate(env); |
| 121 if (obj.is_null()) | 121 if (obj.is_null()) |
| 122 return; | 122 return; |
| 123 Java_WebContentsDelegateAndroid_navigationStateChanged( | 123 Java_WebContentsDelegateAndroid_navigationStateChanged( |
| 124 env, | 124 env, |
| 125 obj.obj(), | 125 obj.obj(), |
| 126 changed_flags); | 126 changed_flags); |
| 127 } | 127 } |
| 128 | 128 |
| 129 void WebContentsDelegateAndroid::VisibleSSLStateChanged( |
| 130 const WebContents* source) { |
| 131 JNIEnv* env = AttachCurrentThread(); |
| 132 ScopedJavaLocalRef<jobject> obj = GetJavaDelegate(env); |
| 133 if (obj.is_null()) |
| 134 return; |
| 135 Java_WebContentsDelegateAndroid_visibleSSLStateChanged( |
| 136 env, |
| 137 obj.obj()); |
| 138 } |
| 139 |
| 129 void WebContentsDelegateAndroid::ActivateContents(WebContents* contents) { | 140 void WebContentsDelegateAndroid::ActivateContents(WebContents* contents) { |
| 130 JNIEnv* env = AttachCurrentThread(); | 141 JNIEnv* env = AttachCurrentThread(); |
| 131 ScopedJavaLocalRef<jobject> obj = GetJavaDelegate(env); | 142 ScopedJavaLocalRef<jobject> obj = GetJavaDelegate(env); |
| 132 if (obj.is_null()) | 143 if (obj.is_null()) |
| 133 return; | 144 return; |
| 134 Java_WebContentsDelegateAndroid_activateContents(env, obj.obj()); | 145 Java_WebContentsDelegateAndroid_activateContents(env, obj.obj()); |
| 135 } | 146 } |
| 136 | 147 |
| 137 void WebContentsDelegateAndroid::DeactivateContents(WebContents* contents) { | 148 void WebContentsDelegateAndroid::DeactivateContents(WebContents* contents) { |
| 138 // On desktop the current window is deactivated here, bringing the next window | 149 // On desktop the current window is deactivated here, bringing the next window |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 348 // Native JNI methods | 359 // Native JNI methods |
| 349 // ---------------------------------------------------------------------------- | 360 // ---------------------------------------------------------------------------- |
| 350 | 361 |
| 351 // Register native methods | 362 // Register native methods |
| 352 | 363 |
| 353 bool RegisterWebContentsDelegateAndroid(JNIEnv* env) { | 364 bool RegisterWebContentsDelegateAndroid(JNIEnv* env) { |
| 354 return RegisterNativesImpl(env); | 365 return RegisterNativesImpl(env); |
| 355 } | 366 } |
| 356 | 367 |
| 357 } // namespace web_contents_delegate_android | 368 } // namespace web_contents_delegate_android |
| OLD | NEW |