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

Side by Side Diff: content/browser/renderer_host/resource_dispatcher_host.cc

Issue 6973052: When the download folder does not exist, change the download folder to a user's "Downloads" (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Remove DownloadTest.DownloadFolder2 and SavePageBrowserTest.SaveFolder4 Created 9 years, 6 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc e-loading 5 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc e-loading
6 6
7 #include "content/browser/renderer_host/resource_dispatcher_host.h" 7 #include "content/browser/renderer_host/resource_dispatcher_host.h"
8 8
9 #include <set> 9 #include <set>
10 #include <vector> 10 #include <vector>
(...skipping 723 matching lines...) Expand 10 before | Expand all | Expand 10 after
734 734
735 BeginRequestInternal(request); 735 BeginRequestInternal(request);
736 } 736 }
737 737
738 // This function is only used for saving feature. 738 // This function is only used for saving feature.
739 void ResourceDispatcherHost::BeginSaveFile( 739 void ResourceDispatcherHost::BeginSaveFile(
740 const GURL& url, 740 const GURL& url,
741 const GURL& referrer, 741 const GURL& referrer,
742 int child_id, 742 int child_id,
743 int route_id, 743 int route_id,
744 const FilePath& default_download_dir,
744 const content::ResourceContext& context) { 745 const content::ResourceContext& context) {
745 if (is_shutdown_) 746 if (is_shutdown_)
746 return; 747 return;
747 748
748 scoped_refptr<ResourceHandler> handler( 749 scoped_refptr<ResourceHandler> handler(
749 new SaveFileResourceHandler(child_id, 750 new SaveFileResourceHandler(child_id,
750 route_id, 751 route_id,
751 url, 752 url,
753 default_download_dir,
752 save_file_manager_.get())); 754 save_file_manager_.get()));
753 request_id_--; 755 request_id_--;
754 756
755 const net::URLRequestContext* request_context = context.request_context(); 757 const net::URLRequestContext* request_context = context.request_context();
756 bool known_proto = 758 bool known_proto =
757 request_context->job_factory()->IsHandledURL(url); 759 request_context->job_factory()->IsHandledURL(url);
758 if (!known_proto) { 760 if (!known_proto) {
759 // Since any URLs which have non-standard scheme have been filtered 761 // Since any URLs which have non-standard scheme have been filtered
760 // by save manager(see GURL::SchemeIsStandard). This situation 762 // by save manager(see GURL::SchemeIsStandard). This situation
761 // should not happen. 763 // should not happen.
(...skipping 1242 matching lines...) Expand 10 before | Expand all | Expand 10 after
2004 return HTTP_AUTH_RESOURCE_BLOCKED_CROSS; 2006 return HTTP_AUTH_RESOURCE_BLOCKED_CROSS;
2005 } 2007 }
2006 2008
2007 bool ResourceDispatcherHost::allow_cross_origin_auth_prompt() { 2009 bool ResourceDispatcherHost::allow_cross_origin_auth_prompt() {
2008 return allow_cross_origin_auth_prompt_; 2010 return allow_cross_origin_auth_prompt_;
2009 } 2011 }
2010 2012
2011 void ResourceDispatcherHost::set_allow_cross_origin_auth_prompt(bool value) { 2013 void ResourceDispatcherHost::set_allow_cross_origin_auth_prompt(bool value) {
2012 allow_cross_origin_auth_prompt_ = value; 2014 allow_cross_origin_auth_prompt_ = value;
2013 } 2015 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698