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

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

Issue 18286004: Move PathExists to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 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 | « content/shell/shell_browser_main.cc ('k') | content/test/image_decoder_test.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 "content/shell/shell_download_manager_delegate.h" 5 #include "content/shell/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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 } 98 }
99 return true; 99 return true;
100 } 100 }
101 101
102 void ShellDownloadManagerDelegate::GenerateFilename( 102 void ShellDownloadManagerDelegate::GenerateFilename(
103 int32 download_id, 103 int32 download_id,
104 const DownloadTargetCallback& callback, 104 const DownloadTargetCallback& callback,
105 const base::FilePath& generated_name, 105 const base::FilePath& generated_name,
106 const base::FilePath& suggested_directory) { 106 const base::FilePath& suggested_directory) {
107 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); 107 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
108 if (!file_util::PathExists(suggested_directory)) 108 if (!base::PathExists(suggested_directory))
109 file_util::CreateDirectory(suggested_directory); 109 file_util::CreateDirectory(suggested_directory);
110 110
111 base::FilePath suggested_path(suggested_directory.Append(generated_name)); 111 base::FilePath suggested_path(suggested_directory.Append(generated_name));
112 BrowserThread::PostTask( 112 BrowserThread::PostTask(
113 BrowserThread::UI, 113 BrowserThread::UI,
114 FROM_HERE, 114 FROM_HERE,
115 base::Bind( 115 base::Bind(
116 &ShellDownloadManagerDelegate::OnDownloadPathGenerated, 116 &ShellDownloadManagerDelegate::OnDownloadPathGenerated,
117 this, download_id, callback, suggested_path)); 117 this, download_id, callback, suggested_path));
118 } 118 }
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS, result); 196 DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS, result);
197 } 197 }
198 198
199 void ShellDownloadManagerDelegate::SetDownloadBehaviorForTesting( 199 void ShellDownloadManagerDelegate::SetDownloadBehaviorForTesting(
200 const base::FilePath& default_download_path) { 200 const base::FilePath& default_download_path) {
201 default_download_path_ = default_download_path; 201 default_download_path_ = default_download_path;
202 suppress_prompting_ = true; 202 suppress_prompting_ = true;
203 } 203 }
204 204
205 } // namespace content 205 } // namespace content
OLDNEW
« no previous file with comments | « content/shell/shell_browser_main.cc ('k') | content/test/image_decoder_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698