| 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_manager.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" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 AwContents* aw_contents = AwContents::FromWebContents(web_contents); | 45 AwContents* aw_contents = AwContents::FromWebContents(web_contents); |
| 46 if (!aw_contents) | 46 if (!aw_contents) |
| 47 return; | 47 return; |
| 48 | 48 |
| 49 aw_contents->GetFindHelper()->HandleFindReply(request_id, | 49 aw_contents->GetFindHelper()->HandleFindReply(request_id, |
| 50 number_of_matches, | 50 number_of_matches, |
| 51 active_match_ordinal, | 51 active_match_ordinal, |
| 52 final_update); | 52 final_update); |
| 53 } | 53 } |
| 54 | 54 |
| 55 bool AwWebContentsDelegate::CanDownload(content::RenderViewHost* source, | 55 void AwWebContentsDelegate::CanDownload( |
| 56 int request_id, | 56 content::RenderViewHost* source, |
| 57 const std::string& request_method) { | 57 int request_id, |
| 58 const std::string& request_method, |
| 59 const base::Callback<void(bool)>& callback) { |
| 58 // Android webview intercepts download in its resource dispatcher host | 60 // Android webview intercepts download in its resource dispatcher host |
| 59 // delegate, so should not reach here. | 61 // delegate, so should not reach here. |
| 60 NOTREACHED(); | 62 NOTREACHED(); |
| 61 return false; | 63 callback.Run(false); |
| 62 } | 64 } |
| 63 | 65 |
| 64 void AwWebContentsDelegate::AddNewContents(content::WebContents* source, | 66 void AwWebContentsDelegate::AddNewContents(content::WebContents* source, |
| 65 content::WebContents* new_contents, | 67 content::WebContents* new_contents, |
| 66 WindowOpenDisposition disposition, | 68 WindowOpenDisposition disposition, |
| 67 const gfx::Rect& initial_pos, | 69 const gfx::Rect& initial_pos, |
| 68 bool user_gesture, | 70 bool user_gesture, |
| 69 bool* was_blocked) { | 71 bool* was_blocked) { |
| 70 JNIEnv* env = AttachCurrentThread(); | 72 JNIEnv* env = AttachCurrentThread(); |
| 71 | 73 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 if (java_delegate.obj()) { | 120 if (java_delegate.obj()) { |
| 119 Java_AwWebContentsDelegate_activateContents(env, java_delegate.obj()); | 121 Java_AwWebContentsDelegate_activateContents(env, java_delegate.obj()); |
| 120 } | 122 } |
| 121 } | 123 } |
| 122 | 124 |
| 123 bool RegisterAwWebContentsDelegate(JNIEnv* env) { | 125 bool RegisterAwWebContentsDelegate(JNIEnv* env) { |
| 124 return RegisterNativesImpl(env); | 126 return RegisterNativesImpl(env); |
| 125 } | 127 } |
| 126 | 128 |
| 127 } // namespace android_webview | 129 } // namespace android_webview |
| OLD | NEW |