Chromium Code Reviews| 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 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 452 | 452 |
| 453 if (original_manifest) | 453 if (original_manifest) |
| 454 original_manifest_.reset(new Manifest( | 454 original_manifest_.reset(new Manifest( |
| 455 Manifest::INVALID_LOCATION, | 455 Manifest::INVALID_LOCATION, |
| 456 scoped_ptr<base::DictionaryValue>(original_manifest->DeepCopy()))); | 456 scoped_ptr<base::DictionaryValue>(original_manifest->DeepCopy()))); |
| 457 | 457 |
| 458 // We don't have to delete the unpack dir explicity since it is a child of | 458 // We don't have to delete the unpack dir explicity since it is a child of |
| 459 // the temp dir. | 459 // the temp dir. |
| 460 unpacked_extension_root_ = extension_dir; | 460 unpacked_extension_root_ = extension_dir; |
| 461 | 461 |
| 462 if (!BrowserThread::PostTask( | |
| 463 BrowserThread::UI, | |
| 464 FROM_HERE, | |
| 465 base::Bind(&CrxInstaller::InitializeExtensionPermissions, this))) | |
|
Devlin
2014/09/09 16:04:26
Ew. We already bounce around a ton in extension i
gpdavis
2014/09/09 17:48:53
Well, the goal here is to call InitializePermissio
Devlin
2014/09/09 17:57:44
Hmm... that makes me wonder if this is actually th
| |
| 466 NOTREACHED(); | |
| 467 } | |
| 468 | |
| 469 void CrxInstaller::InitializeExtensionPermissions() { | |
| 470 DCHECK_CURRENTLY_ON(BrowserThread::UI); | |
| 471 PermissionsUpdater(profile()).InitializePermissions( | |
| 472 install_checker_.extension().get()); | |
| 473 if (!installer_task_runner_->PostTask( | |
| 474 FROM_HERE, | |
| 475 base::Bind(&CrxInstaller::ContinueUnpackSuccess, this))) | |
| 476 NOTREACHED(); | |
| 477 } | |
| 478 | |
| 479 void CrxInstaller::ContinueUnpackSuccess() { | |
| 480 DCHECK(installer_task_runner_->RunsTasksOnCurrentThread()); | |
| 481 const Extension* extension = install_checker_.extension().get(); | |
| 462 CrxInstallerError error = AllowInstall(extension); | 482 CrxInstallerError error = AllowInstall(extension); |
| 463 if (error.type() != CrxInstallerError::ERROR_NONE) { | 483 if (error.type() != CrxInstallerError::ERROR_NONE) { |
| 464 ReportFailureFromFileThread(error); | 484 ReportFailureFromFileThread(error); |
| 465 return; | 485 return; |
| 466 } | 486 } |
| 467 | 487 |
| 468 if (!BrowserThread::PostTask(BrowserThread::UI, | 488 if (!BrowserThread::PostTask(BrowserThread::UI, |
| 469 FROM_HERE, | 489 FROM_HERE, |
| 470 base::Bind(&CrxInstaller::CheckInstall, this))) | 490 base::Bind(&CrxInstaller::CheckInstall, this))) |
| 471 NOTREACHED(); | 491 NOTREACHED(); |
| (...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 890 if (!prefs->DidExtensionEscalatePermissions(extension()->id())) | 910 if (!prefs->DidExtensionEscalatePermissions(extension()->id())) |
| 891 return; | 911 return; |
| 892 | 912 |
| 893 if (client_) { | 913 if (client_) { |
| 894 AddRef(); // Balanced in InstallUIProceed() and InstallUIAbort(). | 914 AddRef(); // Balanced in InstallUIProceed() and InstallUIAbort(). |
| 895 client_->ConfirmReEnable(this, extension()); | 915 client_->ConfirmReEnable(this, extension()); |
| 896 } | 916 } |
| 897 } | 917 } |
| 898 | 918 |
| 899 } // namespace extensions | 919 } // namespace extensions |
| OLD | NEW |