Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(52)

Side by Side Diff: chrome/browser/android/chrome_web_contents_delegate_android.cc

Issue 13609002: fix a problem that android cannot download files with basic authentication (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 bool 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 if (request_method == net::HttpRequestHeaders::kGetMethod) { 235 bool has_auth) {
236 if (request_method == net::HttpRequestHeaders::kGetMethod && !has_auth) {
236 content::DownloadControllerAndroid::Get()->CreateGETDownload( 237 content::DownloadControllerAndroid::Get()->CreateGETDownload(
237 source, request_id); 238 source, request_id);
238 return false; 239 return 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 return true;
244 } 245 }
245 246
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698