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

Side by Side Diff: content/browser/download/save_package.cc

Issue 19052005: Move PathIsWritable, DirectoryExists, ContentsEqual, and TextContentsEqual to the 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
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 1328 matching lines...) Expand 10 before | Expand all | Expand 10 after
1339 1339
1340 void SavePackage::CreateDirectoryOnFileThread( 1340 void SavePackage::CreateDirectoryOnFileThread(
1341 const base::FilePath& website_save_dir, 1341 const base::FilePath& website_save_dir,
1342 const base::FilePath& download_save_dir, 1342 const base::FilePath& download_save_dir,
1343 bool skip_dir_check, 1343 bool skip_dir_check,
1344 const std::string& mime_type, 1344 const std::string& mime_type,
1345 const std::string& accept_langs) { 1345 const std::string& accept_langs) {
1346 base::FilePath save_dir; 1346 base::FilePath save_dir;
1347 // If the default html/websites save folder doesn't exist... 1347 // If the default html/websites save folder doesn't exist...
1348 // We skip the directory check for gdata directories on ChromeOS. 1348 // We skip the directory check for gdata directories on ChromeOS.
1349 if (!skip_dir_check && !file_util::DirectoryExists(website_save_dir)) { 1349 if (!skip_dir_check && !base::DirectoryExists(website_save_dir)) {
1350 // If the default download dir doesn't exist, create it. 1350 // If the default download dir doesn't exist, create it.
1351 if (!file_util::DirectoryExists(download_save_dir)) { 1351 if (!base::DirectoryExists(download_save_dir)) {
1352 bool res = file_util::CreateDirectory(download_save_dir); 1352 bool res = file_util::CreateDirectory(download_save_dir);
1353 DCHECK(res); 1353 DCHECK(res);
1354 } 1354 }
1355 save_dir = download_save_dir; 1355 save_dir = download_save_dir;
1356 } else { 1356 } else {
1357 // If it does exist, use the default save dir param. 1357 // If it does exist, use the default save dir param.
1358 save_dir = website_save_dir; 1358 save_dir = website_save_dir;
1359 } 1359 }
1360 1360
1361 bool can_save_as_complete = CanSaveAsComplete(mime_type); 1361 bool can_save_as_complete = CanSaveAsComplete(mime_type);
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
1446 1446
1447 void SavePackage::FinalizeDownloadEntry() { 1447 void SavePackage::FinalizeDownloadEntry() {
1448 DCHECK(download_); 1448 DCHECK(download_);
1449 DCHECK(download_manager_); 1449 DCHECK(download_manager_);
1450 1450
1451 download_manager_->OnSavePackageSuccessfullyFinished(download_); 1451 download_manager_->OnSavePackageSuccessfullyFinished(download_);
1452 StopObservation(); 1452 StopObservation();
1453 } 1453 }
1454 1454
1455 } // namespace content 1455 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/download/file_metadata_linux.cc ('k') | content/browser/gpu/webgl_conformance_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698