| 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/crx_installer.h" | 5 #include "chrome/browser/extensions/crx_installer.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 379 // the temp dir. | 379 // the temp dir. |
| 380 unpacked_extension_root_ = extension_dir; | 380 unpacked_extension_root_ = extension_dir; |
| 381 | 381 |
| 382 CrxInstallerError error = AllowInstall(extension); | 382 CrxInstallerError error = AllowInstall(extension); |
| 383 if (error.type() != CrxInstallerError::ERROR_NONE) { | 383 if (error.type() != CrxInstallerError::ERROR_NONE) { |
| 384 ReportFailureFromFileThread(error); | 384 ReportFailureFromFileThread(error); |
| 385 return; | 385 return; |
| 386 } | 386 } |
| 387 | 387 |
| 388 if (client_) { | 388 if (client_) { |
| 389 IconsInfo::DecodeIcon(installer_.extension(), | 389 IconsInfo::DecodeIcon(installer_.extension().get(), |
| 390 extension_misc::EXTENSION_ICON_LARGE, | 390 extension_misc::EXTENSION_ICON_LARGE, |
| 391 ExtensionIconSet::MATCH_BIGGER, | 391 ExtensionIconSet::MATCH_BIGGER, |
| 392 &install_icon_); | 392 &install_icon_); |
| 393 } | 393 } |
| 394 | 394 |
| 395 if (!BrowserThread::PostTask( | 395 if (!BrowserThread::PostTask( |
| 396 BrowserThread::UI, FROM_HERE, | 396 BrowserThread::UI, FROM_HERE, |
| 397 base::Bind(&CrxInstaller::CheckImportsAndRequirements, this))) | 397 base::Bind(&CrxInstaller::CheckImportsAndRequirements, this))) |
| 398 NOTREACHED(); | 398 NOTREACHED(); |
| 399 } | 399 } |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 588 // TODO(aa): All paths to resources inside extensions should be created | 588 // TODO(aa): All paths to resources inside extensions should be created |
| 589 // lazily and based on the Extension's root path at that moment. | 589 // lazily and based on the Extension's root path at that moment. |
| 590 // TODO(rdevlin.cronin): Continue removing std::string errors and replacing | 590 // TODO(rdevlin.cronin): Continue removing std::string errors and replacing |
| 591 // with string16 | 591 // with string16 |
| 592 std::string extension_id = extension()->id(); | 592 std::string extension_id = extension()->id(); |
| 593 std::string error; | 593 std::string error; |
| 594 installer_.set_extension(extension_file_util::LoadExtension( | 594 installer_.set_extension(extension_file_util::LoadExtension( |
| 595 version_dir, | 595 version_dir, |
| 596 install_source_, | 596 install_source_, |
| 597 extension()->creation_flags() | Extension::REQUIRE_KEY, | 597 extension()->creation_flags() | Extension::REQUIRE_KEY, |
| 598 &error)); | 598 &error).get()); |
| 599 | 599 |
| 600 if (extension()) { | 600 if (extension()) { |
| 601 ReportSuccessFromFileThread(); | 601 ReportSuccessFromFileThread(); |
| 602 } else { | 602 } else { |
| 603 LOG(ERROR) << error << " " << extension_id << " " << download_url_; | 603 LOG(ERROR) << error << " " << extension_id << " " << download_url_; |
| 604 ReportFailureFromFileThread(CrxInstallerError(UTF8ToUTF16(error))); | 604 ReportFailureFromFileThread(CrxInstallerError(UTF8ToUTF16(error))); |
| 605 } | 605 } |
| 606 | 606 |
| 607 } | 607 } |
| 608 | 608 |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 790 if (!prefs->DidExtensionEscalatePermissions(extension()->id())) | 790 if (!prefs->DidExtensionEscalatePermissions(extension()->id())) |
| 791 return; | 791 return; |
| 792 | 792 |
| 793 if (client_) { | 793 if (client_) { |
| 794 AddRef(); // Balanced in InstallUIProceed() and InstallUIAbort(). | 794 AddRef(); // Balanced in InstallUIProceed() and InstallUIAbort(). |
| 795 client_->ConfirmReEnable(this, extension()); | 795 client_->ConfirmReEnable(this, extension()); |
| 796 } | 796 } |
| 797 } | 797 } |
| 798 | 798 |
| 799 } // namespace extensions | 799 } // namespace extensions |
| OLD | NEW |