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

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

Issue 8351052: Created a DownloadManager interface, for use in unit tests.. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed Mac & Clang issues. Created 9 years, 1 month 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 #include "content/shell/shell_download_manager_delegate.h" 5 #include "content/shell/shell_download_manager_delegate.h"
6 6
7 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include <windows.h> 8 #include <windows.h>
9 #include <commdlg.h> 9 #include <commdlg.h>
10 #endif 10 #endif
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 &ShellDownloadManagerDelegate::GenerateFilename, 65 &ShellDownloadManagerDelegate::GenerateFilename,
66 this, download_id, state, generated_name)); 66 this, download_id, state, generated_name));
67 return false; 67 return false;
68 } 68 }
69 69
70 void ShellDownloadManagerDelegate::GenerateFilename( 70 void ShellDownloadManagerDelegate::GenerateFilename(
71 int32 download_id, 71 int32 download_id,
72 DownloadStateInfo state, 72 DownloadStateInfo state,
73 const FilePath& generated_name) { 73 const FilePath& generated_name) {
74 if (state.suggested_path.empty()) { 74 if (state.suggested_path.empty()) {
75 state.suggested_path = download_manager_->browser_context()->GetPath(). 75 state.suggested_path = download_manager_->BrowserContext()->GetPath().
76 Append(FILE_PATH_LITERAL("Downloads")); 76 Append(FILE_PATH_LITERAL("Downloads"));
77 if (!file_util::PathExists(state.suggested_path)) 77 if (!file_util::PathExists(state.suggested_path))
78 file_util::CreateDirectory(state.suggested_path); 78 file_util::CreateDirectory(state.suggested_path);
79 } 79 }
80 80
81 state.suggested_path = state.suggested_path.Append(generated_name); 81 state.suggested_path = state.suggested_path.Append(generated_name);
82 82
83 BrowserThread::PostTask( 83 BrowserThread::PostTask(
84 BrowserThread::UI, 84 BrowserThread::UI,
85 FROM_HERE, 85 FROM_HERE,
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 void ShellDownloadManagerDelegate::ChooseSavePath( 200 void ShellDownloadManagerDelegate::ChooseSavePath(
201 const base::WeakPtr<SavePackage>& save_package, 201 const base::WeakPtr<SavePackage>& save_package,
202 const FilePath& suggested_path, 202 const FilePath& suggested_path,
203 bool can_save_as_complete) { 203 bool can_save_as_complete) {
204 } 204 }
205 205
206 void ShellDownloadManagerDelegate::DownloadProgressUpdated() { 206 void ShellDownloadManagerDelegate::DownloadProgressUpdated() {
207 } 207 }
208 208
209 } // namespace content 209 } // namespace content
OLDNEW
« content/browser/download/download_manager.h ('K') | « content/content_tests.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698