| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/crx_installer.h" | 5 #include "chrome/browser/extensions/crx_installer.h" |
| 6 | 6 |
| 7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "app/resource_bundle.h" | 8 #include "app/resource_bundle.h" |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/scoped_temp_dir.h" | 10 #include "base/scoped_temp_dir.h" |
| 11 #include "base/task.h" | 11 #include "base/task.h" |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 << " is blacklisted. Install failed."; | 159 << " is blacklisted. Install failed."; |
| 160 ReportFailureFromUIThread("This extension is blacklisted."); | 160 ReportFailureFromUIThread("This extension is blacklisted."); |
| 161 return; | 161 return; |
| 162 } | 162 } |
| 163 | 163 |
| 164 current_version_ = | 164 current_version_ = |
| 165 frontend_->extension_prefs()->GetVersionString(extension_->id()); | 165 frontend_->extension_prefs()->GetVersionString(extension_->id()); |
| 166 | 166 |
| 167 if (client_.get()) { | 167 if (client_.get()) { |
| 168 AddRef(); // Balanced in Proceed() and Abort(). | 168 AddRef(); // Balanced in Proceed() and Abort(). |
| 169 client_->ConfirmInstall(this, extension_.get(), install_icon_.get()); | 169 client_->ConfirmInstall(this, extension_.get()); |
| 170 } else { | 170 } else { |
| 171 ChromeThread::PostTask( | 171 ChromeThread::PostTask( |
| 172 ChromeThread::FILE, FROM_HERE, | 172 ChromeThread::FILE, FROM_HERE, |
| 173 NewRunnableMethod(this, &CrxInstaller::CompleteInstall)); | 173 NewRunnableMethod(this, &CrxInstaller::CompleteInstall)); |
| 174 } | 174 } |
| 175 return; | 175 return; |
| 176 } | 176 } |
| 177 | 177 |
| 178 void CrxInstaller::InstallUIProceed(bool create_app_shortcut) { | 178 void CrxInstaller::InstallUIProceed(bool create_app_shortcut) { |
| 179 if (create_app_shortcut) { | 179 if (create_app_shortcut) { |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 client_->OnInstallSuccess(extension_.get()); | 322 client_->OnInstallSuccess(extension_.get()); |
| 323 | 323 |
| 324 // Tell the frontend about the installation and hand off ownership of | 324 // Tell the frontend about the installation and hand off ownership of |
| 325 // extension_ to it. | 325 // extension_ to it. |
| 326 frontend_->OnExtensionInstalled(extension_.release(), | 326 frontend_->OnExtensionInstalled(extension_.release(), |
| 327 allow_privilege_increase_); | 327 allow_privilege_increase_); |
| 328 | 328 |
| 329 // We're done. We don't post any more tasks to ourselves so we are deleted | 329 // We're done. We don't post any more tasks to ourselves so we are deleted |
| 330 // soon. | 330 // soon. |
| 331 } | 331 } |
| OLD | NEW |