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

Side by Side Diff: chrome/browser/extensions/webstore_installer.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 "chrome/browser/extensions/webstore_installer.h" 5 #include "chrome/browser/extensions/webstore_installer.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 *g_download_directory_for_tests : download_directory); 81 *g_download_directory_for_tests : download_directory);
82 82
83 #if defined(OS_CHROMEOS) 83 #if defined(OS_CHROMEOS)
84 // Do not use drive for extension downloads. 84 // Do not use drive for extension downloads.
85 if (drive::util::IsUnderDriveMountPoint(directory)) 85 if (drive::util::IsUnderDriveMountPoint(directory))
86 directory = download_util::GetDefaultDownloadDirectory(); 86 directory = download_util::GetDefaultDownloadDirectory();
87 #endif 87 #endif
88 88
89 // Ensure the download directory exists. TODO(asargent) - make this use 89 // Ensure the download directory exists. TODO(asargent) - make this use
90 // common code from the downloads system. 90 // common code from the downloads system.
91 if (!file_util::DirectoryExists(directory)) { 91 if (!base::DirectoryExists(directory)) {
92 if (!file_util::CreateDirectory(directory)) { 92 if (!file_util::CreateDirectory(directory)) {
93 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, 93 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
94 base::Bind(callback, base::FilePath())); 94 base::Bind(callback, base::FilePath()));
95 return; 95 return;
96 } 96 }
97 } 97 }
98 98
99 // This is to help avoid a race condition between when we generate this 99 // This is to help avoid a race condition between when we generate this
100 // filename and when the download starts writing to it (think concurrently 100 // filename and when the download starts writing to it (think concurrently
101 // running sharded browser tests installing the same test file, for 101 // running sharded browser tests installing the same test file, for
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
459 void WebstoreInstaller::ReportSuccess() { 459 void WebstoreInstaller::ReportSuccess() {
460 if (delegate_) { 460 if (delegate_) {
461 delegate_->OnExtensionInstallSuccess(id_); 461 delegate_->OnExtensionInstallSuccess(id_);
462 delegate_ = NULL; 462 delegate_ = NULL;
463 } 463 }
464 464
465 Release(); // Balanced in Start(). 465 Release(); // Balanced in Start().
466 } 466 }
467 467
468 } // namespace extensions 468 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/platform_app_launcher.cc ('k') | chrome/browser/google/google_update_settings_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698