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/browser/aw_web_contents_delegate.h" | 5 #include "android_webview/browser/aw_web_contents_delegate.h" |
6 | 6 |
7 #include "android_webview/browser/aw_contents.h" | 7 #include "android_webview/browser/aw_contents.h" |
8 #include "android_webview/browser/aw_contents_io_thread_client_impl.h" | 8 #include "android_webview/browser/aw_contents_io_thread_client.h" |
9 #include "android_webview/browser/aw_javascript_dialog_manager.h" | 9 #include "android_webview/browser/aw_javascript_dialog_manager.h" |
10 #include "android_webview/browser/find_helper.h" | 10 #include "android_webview/browser/find_helper.h" |
11 #include "android_webview/browser/permission/media_access_permission_request.h" | 11 #include "android_webview/browser/permission/media_access_permission_request.h" |
12 #include "android_webview/browser/permission/permission_request_handler.h" | 12 #include "android_webview/browser/permission/permission_request_handler.h" |
13 #include "base/android/jni_array.h" | 13 #include "base/android/jni_array.h" |
14 #include "base/android/jni_string.h" | 14 #include "base/android/jni_string.h" |
15 #include "base/android/scoped_java_ref.h" | 15 #include "base/android/scoped_java_ref.h" |
16 #include "base/lazy_instance.h" | 16 #include "base/lazy_instance.h" |
17 #include "base/location.h" | 17 #include "base/location.h" |
18 #include "base/memory/ptr_util.h" | 18 #include "base/memory/ptr_util.h" |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 | 176 |
177 // Notifies the delegate about the creation of a new WebContents. This | 177 // Notifies the delegate about the creation of a new WebContents. This |
178 // typically happens when popups are created. | 178 // typically happens when popups are created. |
179 void AwWebContentsDelegate::WebContentsCreated( | 179 void AwWebContentsDelegate::WebContentsCreated( |
180 WebContents* source_contents, | 180 WebContents* source_contents, |
181 int opener_render_process_id, | 181 int opener_render_process_id, |
182 int opener_render_frame_id, | 182 int opener_render_frame_id, |
183 const std::string& frame_name, | 183 const std::string& frame_name, |
184 const GURL& target_url, | 184 const GURL& target_url, |
185 content::WebContents* new_contents) { | 185 content::WebContents* new_contents) { |
186 AwContentsIoThreadClientImpl::RegisterPendingContents(new_contents); | 186 AwContentsIoThreadClient::RegisterPendingContents(new_contents); |
187 } | 187 } |
188 | 188 |
189 void AwWebContentsDelegate::CloseContents(WebContents* source) { | 189 void AwWebContentsDelegate::CloseContents(WebContents* source) { |
190 JNIEnv* env = AttachCurrentThread(); | 190 JNIEnv* env = AttachCurrentThread(); |
191 | 191 |
192 ScopedJavaLocalRef<jobject> java_delegate = GetJavaDelegate(env); | 192 ScopedJavaLocalRef<jobject> java_delegate = GetJavaDelegate(env); |
193 if (java_delegate.obj()) { | 193 if (java_delegate.obj()) { |
194 Java_AwWebContentsDelegate_closeContents(env, java_delegate); | 194 Java_AwWebContentsDelegate_closeContents(env, java_delegate); |
195 } | 195 } |
196 } | 196 } |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 DVLOG(0) << "File Chooser result: mode = " << mode | 309 DVLOG(0) << "File Chooser result: mode = " << mode |
310 << ", file paths = " << base::JoinString(file_path_str, ":"); | 310 << ", file paths = " << base::JoinString(file_path_str, ":"); |
311 rfh->FilesSelectedInChooser(files, mode); | 311 rfh->FilesSelectedInChooser(files, mode); |
312 } | 312 } |
313 | 313 |
314 bool RegisterAwWebContentsDelegate(JNIEnv* env) { | 314 bool RegisterAwWebContentsDelegate(JNIEnv* env) { |
315 return RegisterNativesImpl(env); | 315 return RegisterNativesImpl(env); |
316 } | 316 } |
317 | 317 |
318 } // namespace android_webview | 318 } // namespace android_webview |
OLD | NEW |