| 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 "chrome/browser/component/web_contents_delegate_android/web_contents_de
legate_android.h" | 5 #include "chrome/browser/component/web_contents_delegate_android/web_contents_de
legate_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_string.h" | 10 #include "base/android/jni_string.h" |
| (...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 | 297 |
| 298 bool WebContentsDelegateAndroid::TakeFocus(WebContents* source, bool reverse) { | 298 bool WebContentsDelegateAndroid::TakeFocus(WebContents* source, bool reverse) { |
| 299 JNIEnv* env = AttachCurrentThread(); | 299 JNIEnv* env = AttachCurrentThread(); |
| 300 ScopedJavaLocalRef<jobject> obj = GetJavaDelegate(env); | 300 ScopedJavaLocalRef<jobject> obj = GetJavaDelegate(env); |
| 301 if (obj.is_null()) | 301 if (obj.is_null()) |
| 302 return WebContentsDelegate::TakeFocus(source, reverse); | 302 return WebContentsDelegate::TakeFocus(source, reverse); |
| 303 return Java_WebContentsDelegateAndroid_takeFocus( | 303 return Java_WebContentsDelegateAndroid_takeFocus( |
| 304 env, obj.obj(), reverse); | 304 env, obj.obj(), reverse); |
| 305 } | 305 } |
| 306 | 306 |
| 307 void WebContentsDelegateAndroid::ShowRepostFormWarningDialog( |
| 308 WebContents* source) { |
| 309 JNIEnv* env = AttachCurrentThread(); |
| 310 ScopedJavaLocalRef<jobject> obj = GetJavaDelegate(env); |
| 311 if (obj.is_null()) |
| 312 return; |
| 313 Java_WebContentsDelegateAndroid_showRepostFormWarningDialog(env, obj.obj()); |
| 314 } |
| 315 |
| 307 // ---------------------------------------------------------------------------- | 316 // ---------------------------------------------------------------------------- |
| 308 // Native JNI methods | 317 // Native JNI methods |
| 309 // ---------------------------------------------------------------------------- | 318 // ---------------------------------------------------------------------------- |
| 310 | 319 |
| 311 // Register native methods | 320 // Register native methods |
| 312 | 321 |
| 313 bool RegisterWebContentsDelegateAndroid(JNIEnv* env) { | 322 bool RegisterWebContentsDelegateAndroid(JNIEnv* env) { |
| 314 if (!HasClass(env, kWebContentsDelegateAndroidClassPath)) { | 323 if (!HasClass(env, kWebContentsDelegateAndroidClassPath)) { |
| 315 DLOG(ERROR) << "Unable to find class WebContentsDelegateAndroid!"; | 324 DLOG(ERROR) << "Unable to find class WebContentsDelegateAndroid!"; |
| 316 return false; | 325 return false; |
| 317 } | 326 } |
| 318 return RegisterNativesImpl(env); | 327 return RegisterNativesImpl(env); |
| 319 } | 328 } |
| 320 | 329 |
| 321 } // namespace web_contents_delegate_android | 330 } // namespace web_contents_delegate_android |
| OLD | NEW |