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

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: Incorporated comments. 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
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 485 matching lines...) Expand 10 before | Expand all | Expand 10 after
496 request->AppendBytesToUpload(iodata_->post_body.data(), 496 request->AppendBytesToUpload(iodata_->post_body.data(),
497 iodata_->post_body.size()); 497 iodata_->post_body.size());
498 } 498 }
499 499
500 // Prevent login prompts for 401/407 responses. 500 // Prevent login prompts for 401/407 responses.
501 request->set_load_flags(request->load_flags() | 501 request->set_load_flags(request->load_flags() |
502 net::LOAD_DO_NOT_PROMPT_FOR_LOGIN); 502 net::LOAD_DO_NOT_PROMPT_FOR_LOGIN);
503 503
504 net::Error error = iodata_->rdh->BeginDownload( 504 net::Error error = iodata_->rdh->BeginDownload(
505 request.Pass(), 505 request.Pass(),
506 false, // is_content_initiated
benjhayden 2012/05/14 13:51:51 This |false| just means that downloads.download()
Randy Smith (Not in Mondays) 2012/05/14 15:55:28 Yes, although I could imagine that we might add ot
506 iodata_->resource_context, 507 iodata_->resource_context,
507 iodata_->render_process_host_id, 508 iodata_->render_process_host_id,
508 iodata_->render_view_host_routing_id, 509 iodata_->render_view_host_routing_id,
509 false, // prefer_cache 510 false, // prefer_cache
510 save_info, 511 save_info,
511 base::Bind(&DownloadsDownloadFunction::OnStarted, this)); 512 base::Bind(&DownloadsDownloadFunction::OnStarted, this));
512 iodata_.reset(); 513 iodata_.reset();
513 514
514 if (error != net::OK) { 515 if (error != net::OK) {
515 BrowserThread::PostTask( 516 BrowserThread::PostTask(
(...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after
1075 ListValue args; 1076 ListValue args;
1076 args.Append(arg); 1077 args.Append(arg);
1077 std::string json_args; 1078 std::string json_args;
1078 base::JSONWriter::Write(&args, &json_args); 1079 base::JSONWriter::Write(&args, &json_args);
1079 profile_->GetExtensionEventRouter()->DispatchEventToRenderers( 1080 profile_->GetExtensionEventRouter()->DispatchEventToRenderers(
1080 event_name, 1081 event_name,
1081 json_args, 1082 json_args,
1082 profile_, 1083 profile_,
1083 GURL()); 1084 GURL());
1084 } 1085 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/plugin_installer.cc » ('j') | content/browser/download/download_manager_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698