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

Side by Side Diff: content/shell/browser/shell_download_manager_delegate.cc

Issue 100573002: Move directory creation functions to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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 | « content/shell/browser/shell_browser_context.cc ('k') | crypto/nss_util.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "content/shell/browser/shell_download_manager_delegate.h" 5 #include "content/shell/browser/shell_download_manager_delegate.h"
6 6
7 #if defined(TOOLKIT_GTK) 7 #if defined(TOOLKIT_GTK)
8 #include <gtk/gtk.h> 8 #include <gtk/gtk.h>
9 #endif 9 #endif
10 10
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 callback.Run(next_id++); 105 callback.Run(next_id++);
106 } 106 }
107 107
108 void ShellDownloadManagerDelegate::GenerateFilename( 108 void ShellDownloadManagerDelegate::GenerateFilename(
109 uint32 download_id, 109 uint32 download_id,
110 const DownloadTargetCallback& callback, 110 const DownloadTargetCallback& callback,
111 const base::FilePath& generated_name, 111 const base::FilePath& generated_name,
112 const base::FilePath& suggested_directory) { 112 const base::FilePath& suggested_directory) {
113 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); 113 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
114 if (!base::PathExists(suggested_directory)) 114 if (!base::PathExists(suggested_directory))
115 file_util::CreateDirectory(suggested_directory); 115 base::CreateDirectory(suggested_directory);
116 116
117 base::FilePath suggested_path(suggested_directory.Append(generated_name)); 117 base::FilePath suggested_path(suggested_directory.Append(generated_name));
118 BrowserThread::PostTask( 118 BrowserThread::PostTask(
119 BrowserThread::UI, 119 BrowserThread::UI,
120 FROM_HERE, 120 FROM_HERE,
121 base::Bind( 121 base::Bind(
122 &ShellDownloadManagerDelegate::OnDownloadPathGenerated, 122 &ShellDownloadManagerDelegate::OnDownloadPathGenerated,
123 this, download_id, callback, suggested_path)); 123 this, download_id, callback, suggested_path));
124 } 124 }
125 125
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS, result); 202 DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS, result);
203 } 203 }
204 204
205 void ShellDownloadManagerDelegate::SetDownloadBehaviorForTesting( 205 void ShellDownloadManagerDelegate::SetDownloadBehaviorForTesting(
206 const base::FilePath& default_download_path) { 206 const base::FilePath& default_download_path) {
207 default_download_path_ = default_download_path; 207 default_download_path_ = default_download_path;
208 suppress_prompting_ = true; 208 suppress_prompting_ = true;
209 } 209 }
210 210
211 } // namespace content 211 } // namespace content
OLDNEW
« no previous file with comments | « content/shell/browser/shell_browser_context.cc ('k') | crypto/nss_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698