| OLD | NEW |
| 1 // Copyright (c) 2010 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 <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
| 10 #include "app/resource_bundle.h" | 10 #include "app/resource_bundle.h" |
| (...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 // We don't have to delete the unpack dir explicity since it is a child of | 275 // We don't have to delete the unpack dir explicity since it is a child of |
| 276 // the temp dir. | 276 // the temp dir. |
| 277 unpacked_extension_root_ = extension_dir; | 277 unpacked_extension_root_ = extension_dir; |
| 278 | 278 |
| 279 std::string error; | 279 std::string error; |
| 280 if (!AllowInstall(extension, &error)) { | 280 if (!AllowInstall(extension, &error)) { |
| 281 ReportFailureFromFileThread(error); | 281 ReportFailureFromFileThread(error); |
| 282 return; | 282 return; |
| 283 } | 283 } |
| 284 | 284 |
| 285 if (client_ || extension_->GetFullLaunchURL().is_valid()) { | 285 if (client_) { |
| 286 Extension::DecodeIcon(extension_.get(), Extension::EXTENSION_ICON_LARGE, | 286 Extension::DecodeIcon(extension_.get(), Extension::EXTENSION_ICON_LARGE, |
| 287 &install_icon_); | 287 &install_icon_); |
| 288 } | 288 } |
| 289 | 289 |
| 290 BrowserThread::PostTask( | 290 BrowserThread::PostTask( |
| 291 BrowserThread::UI, FROM_HERE, | 291 BrowserThread::UI, FROM_HERE, |
| 292 NewRunnableMethod(this, &CrxInstaller::ConfirmInstall)); | 292 NewRunnableMethod(this, &CrxInstaller::ConfirmInstall)); |
| 293 } | 293 } |
| 294 | 294 |
| 295 void CrxInstaller::ConfirmInstall() { | 295 void CrxInstaller::ConfirmInstall() { |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 423 BrowserThread::PostTask( | 423 BrowserThread::PostTask( |
| 424 BrowserThread::UI, FROM_HERE, | 424 BrowserThread::UI, FROM_HERE, |
| 425 NewRunnableMethod(this, &CrxInstaller::ReportSuccessFromUIThread)); | 425 NewRunnableMethod(this, &CrxInstaller::ReportSuccessFromUIThread)); |
| 426 } | 426 } |
| 427 | 427 |
| 428 void CrxInstaller::ReportSuccessFromUIThread() { | 428 void CrxInstaller::ReportSuccessFromUIThread() { |
| 429 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 429 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 430 | 430 |
| 431 // If there is a client, tell the client about installation. | 431 // If there is a client, tell the client about installation. |
| 432 if (client_) | 432 if (client_) |
| 433 client_->OnInstallSuccess(extension_.get()); | 433 client_->OnInstallSuccess(extension_.get(), install_icon_.get()); |
| 434 | 434 |
| 435 // Tell the frontend about the installation and hand off ownership of | 435 // Tell the frontend about the installation and hand off ownership of |
| 436 // extension_ to it. | 436 // extension_ to it. |
| 437 frontend_->OnExtensionInstalled(extension_); | 437 frontend_->OnExtensionInstalled(extension_); |
| 438 extension_ = NULL; | 438 extension_ = NULL; |
| 439 | 439 |
| 440 // We're done. We don't post any more tasks to ourselves so we are deleted | 440 // We're done. We don't post any more tasks to ourselves so we are deleted |
| 441 // soon. | 441 // soon. |
| 442 } | 442 } |
| OLD | NEW |