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 "chrome/browser/android/chrome_web_contents_delegate_android.h" | 5 #include "chrome/browser/android/chrome_web_contents_delegate_android.h" |
6 | 6 |
7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "chrome/browser/file_select_helper.h" | 10 #include "chrome/browser/file_select_helper.h" |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 env, | 221 env, |
222 obj.obj(), | 222 obj.obj(), |
223 details_object.obj()); | 223 details_object.obj()); |
224 } | 224 } |
225 | 225 |
226 content::JavaScriptDialogManager* | 226 content::JavaScriptDialogManager* |
227 ChromeWebContentsDelegateAndroid::GetJavaScriptDialogManager() { | 227 ChromeWebContentsDelegateAndroid::GetJavaScriptDialogManager() { |
228 return GetJavaScriptDialogManagerInstance(); | 228 return GetJavaScriptDialogManagerInstance(); |
229 } | 229 } |
230 | 230 |
231 bool ChromeWebContentsDelegateAndroid::CanDownload( | 231 void ChromeWebContentsDelegateAndroid::CanDownload( |
232 content::RenderViewHost* source, | 232 content::RenderViewHost* source, |
233 int request_id, | 233 int request_id, |
234 const std::string& request_method) { | 234 const std::string& request_method, |
| 235 const base::Callback<void(bool)>& callback) { |
235 if (request_method == net::HttpRequestHeaders::kGetMethod) { | 236 if (request_method == net::HttpRequestHeaders::kGetMethod) { |
236 content::DownloadControllerAndroid::Get()->CreateGETDownload( | 237 content::DownloadControllerAndroid::Get()->CreateGETDownload( |
237 source, request_id); | 238 source, request_id); |
238 return false; | 239 callback.Run(false); |
239 } | 240 } |
240 // DownloadControllerAndroid::OnPostDownloadStarted() is called for the | 241 // DownloadControllerAndroid::OnPostDownloadStarted() is called for the |
241 // started download by the default DownloadUIController::Delegate | 242 // started download by the default DownloadUIController::Delegate |
242 // implementation. | 243 // implementation. |
243 return true; | 244 callback.Run(true); |
244 } | 245 } |
245 | 246 |
246 void ChromeWebContentsDelegateAndroid::DidNavigateToPendingEntry( | 247 void ChromeWebContentsDelegateAndroid::DidNavigateToPendingEntry( |
247 content::WebContents* source) { | 248 content::WebContents* source) { |
248 navigation_start_time_ = base::TimeTicks::Now(); | 249 navigation_start_time_ = base::TimeTicks::Now(); |
249 } | 250 } |
250 | 251 |
251 void ChromeWebContentsDelegateAndroid::DidNavigateMainFramePostCommit( | 252 void ChromeWebContentsDelegateAndroid::DidNavigateMainFramePostCommit( |
252 content::WebContents* source) { | 253 content::WebContents* source) { |
253 if (!IsActiveNavigationGoogleSearch(source)) | 254 if (!IsActiveNavigationGoogleSearch(source)) |
(...skipping 24 matching lines...) Expand all Loading... |
278 web_contents, url, plugin_path, callback); | 279 web_contents, url, plugin_path, callback); |
279 return true; | 280 return true; |
280 #else | 281 #else |
281 return false; | 282 return false; |
282 #endif | 283 #endif |
283 } | 284 } |
284 | 285 |
285 | 286 |
286 } // namespace android | 287 } // namespace android |
287 } // namespace chrome | 288 } // namespace chrome |
OLD | NEW |