| 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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 // filename and when the download starts writing to it (think concurrently | 119 // filename and when the download starts writing to it (think concurrently |
| 120 // running sharded browser tests installing the same test file, for | 120 // running sharded browser tests installing the same test file, for |
| 121 // instance). | 121 // instance). |
| 122 std::string random_number = | 122 std::string random_number = |
| 123 base::Uint64ToString(base::RandGenerator(kuint16max)); | 123 base::Uint64ToString(base::RandGenerator(kuint16max)); |
| 124 | 124 |
| 125 base::FilePath file = | 125 base::FilePath file = |
| 126 directory.AppendASCII(id + "_" + random_number + ".crx"); | 126 directory.AppendASCII(id + "_" + random_number + ".crx"); |
| 127 | 127 |
| 128 int uniquifier = | 128 int uniquifier = |
| 129 file_util::GetUniquePathNumber(file, FILE_PATH_LITERAL(std::string())); | 129 file_util::GetUniquePathNumber(file, base::FilePath::StringType()); |
| 130 if (uniquifier > 0) { | 130 if (uniquifier > 0) { |
| 131 file = file.InsertBeforeExtensionASCII( | 131 file = file.InsertBeforeExtensionASCII( |
| 132 base::StringPrintf(" (%d)", uniquifier)); | 132 base::StringPrintf(" (%d)", uniquifier)); |
| 133 } | 133 } |
| 134 | 134 |
| 135 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, | 135 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, |
| 136 base::Bind(callback, file)); | 136 base::Bind(callback, file)); |
| 137 } | 137 } |
| 138 | 138 |
| 139 } // namespace | 139 } // namespace |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 424 void WebstoreInstaller::ReportSuccess() { | 424 void WebstoreInstaller::ReportSuccess() { |
| 425 if (delegate_) { | 425 if (delegate_) { |
| 426 delegate_->OnExtensionInstallSuccess(id_); | 426 delegate_->OnExtensionInstallSuccess(id_); |
| 427 delegate_ = NULL; | 427 delegate_ = NULL; |
| 428 } | 428 } |
| 429 | 429 |
| 430 Release(); // Balanced in Start(). | 430 Release(); // Balanced in Start(). |
| 431 } | 431 } |
| 432 | 432 |
| 433 } // namespace extensions | 433 } // namespace extensions |
| OLD | NEW |