| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |