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

Side by Side Diff: chrome/browser/download/download_extension_api.cc

Issue 10381122: Add flag to specify if explicitly requested download is from web. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync'd to LKGR and integrated into DownloadUrlParams. Created 8 years, 7 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
« no previous file with comments | « no previous file | chrome/browser/plugin_installer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/plugin_installer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698