| 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 "android_webview/native/aw_web_contents_delegate.h" | 5 #include "android_webview/native/aw_web_contents_delegate.h" |
| 6 | 6 |
| 7 #include "android_webview/browser/find_helper.h" | 7 #include "android_webview/browser/find_helper.h" |
| 8 #include "android_webview/native/aw_contents.h" | 8 #include "android_webview/native/aw_contents.h" |
| 9 #include "android_webview/native/aw_javascript_dialog_creator.h" | 9 #include "android_webview/native/aw_javascript_dialog_manager.h" |
| 10 #include "base/android/scoped_java_ref.h" | 10 #include "base/android/scoped_java_ref.h" |
| 11 #include "base/lazy_instance.h" | 11 #include "base/lazy_instance.h" |
| 12 #include "base/message_loop.h" | 12 #include "base/message_loop.h" |
| 13 #include "content/public/browser/web_contents.h" | 13 #include "content/public/browser/web_contents.h" |
| 14 #include "jni/AwWebContentsDelegate_jni.h" | 14 #include "jni/AwWebContentsDelegate_jni.h" |
| 15 | 15 |
| 16 using base::android::AttachCurrentThread; | 16 using base::android::AttachCurrentThread; |
| 17 using base::android::ScopedJavaLocalRef; | 17 using base::android::ScopedJavaLocalRef; |
| 18 using content::WebContents; | 18 using content::WebContents; |
| 19 | 19 |
| 20 namespace android_webview { | 20 namespace android_webview { |
| 21 | 21 |
| 22 static base::LazyInstance<AwJavaScriptDialogCreator>::Leaky | 22 static base::LazyInstance<AwJavaScriptDialogManager>::Leaky |
| 23 g_javascript_dialog_creator = LAZY_INSTANCE_INITIALIZER; | 23 g_javascript_dialog_manager = LAZY_INSTANCE_INITIALIZER; |
| 24 | 24 |
| 25 AwWebContentsDelegate::AwWebContentsDelegate( | 25 AwWebContentsDelegate::AwWebContentsDelegate( |
| 26 JNIEnv* env, | 26 JNIEnv* env, |
| 27 jobject obj) | 27 jobject obj) |
| 28 : WebContentsDelegateAndroid(env, obj) { | 28 : WebContentsDelegateAndroid(env, obj) { |
| 29 } | 29 } |
| 30 | 30 |
| 31 AwWebContentsDelegate::~AwWebContentsDelegate() { | 31 AwWebContentsDelegate::~AwWebContentsDelegate() { |
| 32 } | 32 } |
| 33 | 33 |
| 34 content::JavaScriptDialogCreator* | 34 content::JavaScriptDialogManager* |
| 35 AwWebContentsDelegate::GetJavaScriptDialogCreator() { | 35 AwWebContentsDelegate::GetJavaScriptDialogManager() { |
| 36 return g_javascript_dialog_creator.Pointer(); | 36 return g_javascript_dialog_manager.Pointer(); |
| 37 } | 37 } |
| 38 | 38 |
| 39 void AwWebContentsDelegate::FindReply(WebContents* web_contents, | 39 void AwWebContentsDelegate::FindReply(WebContents* web_contents, |
| 40 int request_id, | 40 int request_id, |
| 41 int number_of_matches, | 41 int number_of_matches, |
| 42 const gfx::Rect& selection_rect, | 42 const gfx::Rect& selection_rect, |
| 43 int active_match_ordinal, | 43 int active_match_ordinal, |
| 44 bool final_update) { | 44 bool final_update) { |
| 45 AwContents* aw_contents = AwContents::FromWebContents(web_contents); | 45 AwContents* aw_contents = AwContents::FromWebContents(web_contents); |
| 46 if (!aw_contents) | 46 if (!aw_contents) |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 if (java_delegate.obj()) { | 123 if (java_delegate.obj()) { |
| 124 Java_AwWebContentsDelegate_activateContents(env, java_delegate.obj()); | 124 Java_AwWebContentsDelegate_activateContents(env, java_delegate.obj()); |
| 125 } | 125 } |
| 126 } | 126 } |
| 127 | 127 |
| 128 bool RegisterAwWebContentsDelegate(JNIEnv* env) { | 128 bool RegisterAwWebContentsDelegate(JNIEnv* env) { |
| 129 return RegisterNativesImpl(env); | 129 return RegisterNativesImpl(env); |
| 130 } | 130 } |
| 131 | 131 |
| 132 } // namespace android_webview | 132 } // namespace android_webview |
| OLD | NEW |