| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 | 54 |
| 55 bool AwWebContentsDelegate::CanDownload(content::RenderViewHost* source, | 55 bool AwWebContentsDelegate::CanDownload(content::RenderViewHost* source, |
| 56 int request_id, | 56 int request_id, |
| 57 const std::string& request_method) { | 57 const std::string& request_method) { |
| 58 // Android webview intercepts download in its resource dispatcher host | 58 // Android webview intercepts download in its resource dispatcher host |
| 59 // delegate, so should not reach here. | 59 // delegate, so should not reach here. |
| 60 NOTREACHED(); | 60 NOTREACHED(); |
| 61 return false; | 61 return false; |
| 62 } | 62 } |
| 63 | 63 |
| 64 void AwWebContentsDelegate::OnStartDownload(WebContents* source, | |
| 65 content::DownloadItem* download) { | |
| 66 NOTREACHED(); // Downloads are cancelled in ResourceDispatcherHostDelegate. | |
| 67 } | |
| 68 | |
| 69 void AwWebContentsDelegate::AddNewContents(content::WebContents* source, | 64 void AwWebContentsDelegate::AddNewContents(content::WebContents* source, |
| 70 content::WebContents* new_contents, | 65 content::WebContents* new_contents, |
| 71 WindowOpenDisposition disposition, | 66 WindowOpenDisposition disposition, |
| 72 const gfx::Rect& initial_pos, | 67 const gfx::Rect& initial_pos, |
| 73 bool user_gesture, | 68 bool user_gesture, |
| 74 bool* was_blocked) { | 69 bool* was_blocked) { |
| 75 JNIEnv* env = AttachCurrentThread(); | 70 JNIEnv* env = AttachCurrentThread(); |
| 76 | 71 |
| 77 bool is_dialog = disposition == NEW_POPUP; | 72 bool is_dialog = disposition == NEW_POPUP; |
| 78 ScopedJavaLocalRef<jobject> java_delegate = GetJavaDelegate(env); | 73 ScopedJavaLocalRef<jobject> java_delegate = GetJavaDelegate(env); |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 if (java_delegate.obj()) { | 118 if (java_delegate.obj()) { |
| 124 Java_AwWebContentsDelegate_activateContents(env, java_delegate.obj()); | 119 Java_AwWebContentsDelegate_activateContents(env, java_delegate.obj()); |
| 125 } | 120 } |
| 126 } | 121 } |
| 127 | 122 |
| 128 bool RegisterAwWebContentsDelegate(JNIEnv* env) { | 123 bool RegisterAwWebContentsDelegate(JNIEnv* env) { |
| 129 return RegisterNativesImpl(env); | 124 return RegisterNativesImpl(env); |
| 130 } | 125 } |
| 131 | 126 |
| 132 } // namespace android_webview | 127 } // namespace android_webview |
| OLD | NEW |