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/aw_javascript_dialog_manager.h" | 7 #include "android_webview/browser/aw_javascript_dialog_manager.h" |
8 #include "android_webview/browser/find_helper.h" | 8 #include "android_webview/browser/find_helper.h" |
9 #include "android_webview/native/aw_contents.h" | 9 #include "android_webview/native/aw_contents.h" |
10 #include "android_webview/native/aw_contents_io_thread_client_impl.h" | 10 #include "android_webview/native/aw_contents_io_thread_client_impl.h" |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 Java_AwWebContentsDelegate_runFileChooser( | 118 Java_AwWebContentsDelegate_runFileChooser( |
119 env, java_delegate, render_frame_host->GetProcess()->GetID(), | 119 env, java_delegate, render_frame_host->GetProcess()->GetID(), |
120 render_frame_host->GetRoutingID(), mode_flags, | 120 render_frame_host->GetRoutingID(), mode_flags, |
121 ConvertUTF16ToJavaString( | 121 ConvertUTF16ToJavaString( |
122 env, base::JoinString(params.accept_types, base::ASCIIToUTF16(","))), | 122 env, base::JoinString(params.accept_types, base::ASCIIToUTF16(","))), |
123 params.title.empty() ? nullptr | 123 params.title.empty() ? nullptr |
124 : ConvertUTF16ToJavaString(env, params.title), | 124 : ConvertUTF16ToJavaString(env, params.title), |
125 params.default_file_name.empty() | 125 params.default_file_name.empty() |
126 ? nullptr | 126 ? nullptr |
127 : ConvertUTF8ToJavaString(env, params.default_file_name.value()), | 127 : ConvertUTF8ToJavaString(env, params.default_file_name.value()), |
128 params.capture); | 128 ConvertUTF16ToJavaString(env, params.capture)); |
129 } | 129 } |
130 | 130 |
131 void AwWebContentsDelegate::AddNewContents(WebContents* source, | 131 void AwWebContentsDelegate::AddNewContents(WebContents* source, |
132 WebContents* new_contents, | 132 WebContents* new_contents, |
133 WindowOpenDisposition disposition, | 133 WindowOpenDisposition disposition, |
134 const gfx::Rect& initial_rect, | 134 const gfx::Rect& initial_rect, |
135 bool user_gesture, | 135 bool user_gesture, |
136 bool* was_blocked) { | 136 bool* was_blocked) { |
137 JNIEnv* env = AttachCurrentThread(); | 137 JNIEnv* env = AttachCurrentThread(); |
138 | 138 |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 DVLOG(0) << "File Chooser result: mode = " << mode | 313 DVLOG(0) << "File Chooser result: mode = " << mode |
314 << ", file paths = " << base::JoinString(file_path_str, ":"); | 314 << ", file paths = " << base::JoinString(file_path_str, ":"); |
315 rfh->FilesSelectedInChooser(files, mode); | 315 rfh->FilesSelectedInChooser(files, mode); |
316 } | 316 } |
317 | 317 |
318 bool RegisterAwWebContentsDelegate(JNIEnv* env) { | 318 bool RegisterAwWebContentsDelegate(JNIEnv* env) { |
319 return RegisterNativesImpl(env); | 319 return RegisterNativesImpl(env); |
320 } | 320 } |
321 | 321 |
322 } // namespace android_webview | 322 } // namespace android_webview |
OLD | NEW |