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

Side by Side Diff: content/browser/download/save_package.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
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/browser/download/save_package.h" 5 #include "content/browser/download/save_package.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 1329 matching lines...) Expand 10 before | Expand all | Expand 10 after
1340 const base::FilePath& download_save_dir, 1340 const base::FilePath& download_save_dir,
1341 bool skip_dir_check, 1341 bool skip_dir_check,
1342 const std::string& mime_type, 1342 const std::string& mime_type,
1343 const std::string& accept_langs) { 1343 const std::string& accept_langs) {
1344 base::FilePath save_dir; 1344 base::FilePath save_dir;
1345 // If the default html/websites save folder doesn't exist... 1345 // If the default html/websites save folder doesn't exist...
1346 // We skip the directory check for gdata directories on ChromeOS. 1346 // We skip the directory check for gdata directories on ChromeOS.
1347 if (!skip_dir_check && !base::DirectoryExists(website_save_dir)) { 1347 if (!skip_dir_check && !base::DirectoryExists(website_save_dir)) {
1348 // If the default download dir doesn't exist, create it. 1348 // If the default download dir doesn't exist, create it.
1349 if (!base::DirectoryExists(download_save_dir)) { 1349 if (!base::DirectoryExists(download_save_dir)) {
1350 bool res = file_util::CreateDirectory(download_save_dir); 1350 bool res = base::CreateDirectory(download_save_dir);
1351 DCHECK(res); 1351 DCHECK(res);
1352 } 1352 }
1353 save_dir = download_save_dir; 1353 save_dir = download_save_dir;
1354 } else { 1354 } else {
1355 // If it does exist, use the default save dir param. 1355 // If it does exist, use the default save dir param.
1356 save_dir = website_save_dir; 1356 save_dir = website_save_dir;
1357 } 1357 }
1358 1358
1359 bool can_save_as_complete = CanSaveAsComplete(mime_type); 1359 bool can_save_as_complete = CanSaveAsComplete(mime_type);
1360 base::FilePath suggested_filename = GetSuggestedNameForSaveAs( 1360 base::FilePath suggested_filename = GetSuggestedNameForSaveAs(
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
1444 1444
1445 void SavePackage::FinalizeDownloadEntry() { 1445 void SavePackage::FinalizeDownloadEntry() {
1446 DCHECK(download_); 1446 DCHECK(download_);
1447 DCHECK(download_manager_); 1447 DCHECK(download_manager_);
1448 1448
1449 download_manager_->OnSavePackageSuccessfullyFinished(download_); 1449 download_manager_->OnSavePackageSuccessfullyFinished(download_);
1450 StopObservation(); 1450 StopObservation();
1451 } 1451 }
1452 1452
1453 } // namespace content 1453 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/download/save_file_manager.cc ('k') | content/browser/fileapi/obfuscated_file_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698