| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/android/find_in_page/find_in_page_bridge.h" | 5 #include "chrome/browser/android/find_in_page/find_in_page_bridge.h" |
| 6 | 6 |
| 7 #include "base/android/jni_string.h" | 7 #include "base/android/jni_string.h" |
| 8 #include "chrome/browser/ui/find_bar/find_tab_helper.h" | 8 #include "chrome/browser/ui/find_bar/find_tab_helper.h" |
| 9 #include "content/public/browser/web_contents.h" | 9 #include "content/public/browser/web_contents.h" |
| 10 #include "jni/FindInPageBridge_jni.h" | 10 #include "jni/FindInPageBridge_jni.h" |
| 11 | 11 |
| 12 using base::android::ConvertUTF16ToJavaString; | 12 using base::android::ConvertUTF16ToJavaString; |
| 13 | 13 |
| 14 FindInPageBridge::FindInPageBridge(JNIEnv* env, | 14 FindInPageBridge::FindInPageBridge(JNIEnv* env, |
| 15 jobject obj, | 15 jobject obj, |
| 16 jobject j_web_contents) | 16 jobject j_web_contents) |
| 17 : weak_java_ref_(env, obj) { | 17 : weak_java_ref_(env, obj) { |
| 18 #if !defined(USE_AURA) |
| 18 web_contents_ = content::WebContents::FromJavaWebContents(j_web_contents); | 19 web_contents_ = content::WebContents::FromJavaWebContents(j_web_contents); |
| 20 #endif |
| 19 } | 21 } |
| 20 | 22 |
| 21 void FindInPageBridge::Destroy(JNIEnv*, jobject) { | 23 void FindInPageBridge::Destroy(JNIEnv*, jobject) { |
| 22 delete this; | 24 delete this; |
| 23 } | 25 } |
| 24 | 26 |
| 25 void FindInPageBridge::StartFinding(JNIEnv* env, | 27 void FindInPageBridge::StartFinding(JNIEnv* env, |
| 26 jobject obj, | 28 jobject obj, |
| 27 jstring search_string, | 29 jstring search_string, |
| 28 jboolean forward_direction, | 30 jboolean forward_direction, |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 | 70 |
| 69 // static | 71 // static |
| 70 static jlong Init(JNIEnv* env, jobject obj, jobject j_web_contents) { | 72 static jlong Init(JNIEnv* env, jobject obj, jobject j_web_contents) { |
| 71 FindInPageBridge* bridge = new FindInPageBridge(env, obj, j_web_contents); | 73 FindInPageBridge* bridge = new FindInPageBridge(env, obj, j_web_contents); |
| 72 return reinterpret_cast<intptr_t>(bridge); | 74 return reinterpret_cast<intptr_t>(bridge); |
| 73 } | 75 } |
| 74 | 76 |
| 75 bool FindInPageBridge::RegisterFindInPageBridge(JNIEnv* env) { | 77 bool FindInPageBridge::RegisterFindInPageBridge(JNIEnv* env) { |
| 76 return RegisterNativesImpl(env); | 78 return RegisterNativesImpl(env); |
| 77 } | 79 } |
| OLD | NEW |