| 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/download/download_extension_api.h" | 5 #include "chrome/browser/download/download_extension_api.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cctype> | 8 #include <cctype> |
| 9 #include <iterator> | 9 #include <iterator> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 495 request->AppendBytesToUpload(iodata_->post_body.data(), | 495 request->AppendBytesToUpload(iodata_->post_body.data(), |
| 496 iodata_->post_body.size()); | 496 iodata_->post_body.size()); |
| 497 } | 497 } |
| 498 | 498 |
| 499 // Prevent login prompts for 401/407 responses. | 499 // Prevent login prompts for 401/407 responses. |
| 500 request->set_load_flags(request->load_flags() | | 500 request->set_load_flags(request->load_flags() | |
| 501 net::LOAD_DO_NOT_PROMPT_FOR_LOGIN); | 501 net::LOAD_DO_NOT_PROMPT_FOR_LOGIN); |
| 502 | 502 |
| 503 net::Error error = iodata_->rdh->BeginDownload( | 503 net::Error error = iodata_->rdh->BeginDownload( |
| 504 request.Pass(), | 504 request.Pass(), |
| 505 false, // is_content_initiated |
| 505 iodata_->resource_context, | 506 iodata_->resource_context, |
| 506 iodata_->render_process_host_id, | 507 iodata_->render_process_host_id, |
| 507 iodata_->render_view_host_routing_id, | 508 iodata_->render_view_host_routing_id, |
| 508 false, // prefer_cache | 509 false, // prefer_cache |
| 509 save_info, | 510 save_info, |
| 510 base::Bind(&DownloadsDownloadFunction::OnStarted, this)); | 511 base::Bind(&DownloadsDownloadFunction::OnStarted, this)); |
| 511 iodata_.reset(); | 512 iodata_.reset(); |
| 512 | 513 |
| 513 if (error != net::OK) { | 514 if (error != net::OK) { |
| 514 BrowserThread::PostTask( | 515 BrowserThread::PostTask( |
| (...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1074 ListValue args; | 1075 ListValue args; |
| 1075 args.Append(arg); | 1076 args.Append(arg); |
| 1076 std::string json_args; | 1077 std::string json_args; |
| 1077 base::JSONWriter::Write(&args, &json_args); | 1078 base::JSONWriter::Write(&args, &json_args); |
| 1078 profile_->GetExtensionEventRouter()->DispatchEventToRenderers( | 1079 profile_->GetExtensionEventRouter()->DispatchEventToRenderers( |
| 1079 event_name, | 1080 event_name, |
| 1080 json_args, | 1081 json_args, |
| 1081 profile_, | 1082 profile_, |
| 1082 GURL()); | 1083 GURL()); |
| 1083 } | 1084 } |
| OLD | NEW |