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 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 } | 162 } |
163 | 163 |
164 void WebContentsDelegateAndroid::ActivateContents(WebContents* contents) { | 164 void WebContentsDelegateAndroid::ActivateContents(WebContents* contents) { |
165 JNIEnv* env = AttachCurrentThread(); | 165 JNIEnv* env = AttachCurrentThread(); |
166 ScopedJavaLocalRef<jobject> obj = GetJavaDelegate(env); | 166 ScopedJavaLocalRef<jobject> obj = GetJavaDelegate(env); |
167 if (obj.is_null()) | 167 if (obj.is_null()) |
168 return; | 168 return; |
169 Java_WebContentsDelegateAndroid_activateContents(env, obj.obj()); | 169 Java_WebContentsDelegateAndroid_activateContents(env, obj.obj()); |
170 } | 170 } |
171 | 171 |
172 void WebContentsDelegateAndroid::DeactivateContents(WebContents* contents) { | |
173 // On desktop the current window is deactivated here, bringing the next window | |
174 // to focus. Not implemented on Android. | |
175 } | |
176 | |
177 void WebContentsDelegateAndroid::LoadingStateChanged(WebContents* source, | 172 void WebContentsDelegateAndroid::LoadingStateChanged(WebContents* source, |
178 bool to_different_document) { | 173 bool to_different_document) { |
179 JNIEnv* env = AttachCurrentThread(); | 174 JNIEnv* env = AttachCurrentThread(); |
180 ScopedJavaLocalRef<jobject> obj = GetJavaDelegate(env); | 175 ScopedJavaLocalRef<jobject> obj = GetJavaDelegate(env); |
181 if (obj.is_null()) | 176 if (obj.is_null()) |
182 return; | 177 return; |
183 bool has_stopped = source == NULL || !source->IsLoading(); | 178 bool has_stopped = source == NULL || !source->IsLoading(); |
184 | 179 |
185 if (has_stopped) | 180 if (has_stopped) |
186 Java_WebContentsDelegateAndroid_onLoadStopped(env, obj.obj()); | 181 Java_WebContentsDelegateAndroid_onLoadStopped(env, obj.obj()); |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
438 // Native JNI methods | 433 // Native JNI methods |
439 // ---------------------------------------------------------------------------- | 434 // ---------------------------------------------------------------------------- |
440 | 435 |
441 // Register native methods | 436 // Register native methods |
442 | 437 |
443 bool RegisterWebContentsDelegateAndroid(JNIEnv* env) { | 438 bool RegisterWebContentsDelegateAndroid(JNIEnv* env) { |
444 return RegisterNativesImpl(env); | 439 return RegisterNativesImpl(env); |
445 } | 440 } |
446 | 441 |
447 } // namespace web_contents_delegate_android | 442 } // namespace web_contents_delegate_android |
OLD | NEW |