| 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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 | 135 |
| 136 CrxInstaller::~CrxInstaller() { | 136 CrxInstaller::~CrxInstaller() { |
| 137 // Make sure the UI is deleted on the ui thread. | 137 // Make sure the UI is deleted on the ui thread. |
| 138 if (client_) { | 138 if (client_) { |
| 139 BrowserThread::DeleteSoon(BrowserThread::UI, FROM_HERE, client_); | 139 BrowserThread::DeleteSoon(BrowserThread::UI, FROM_HERE, client_); |
| 140 client_ = NULL; | 140 client_ = NULL; |
| 141 } | 141 } |
| 142 } | 142 } |
| 143 | 143 |
| 144 void CrxInstaller::InstallCrx(const base::FilePath& source_file) { | 144 void CrxInstaller::InstallCrx(const base::FilePath& source_file) { |
| 145 ExtensionService* service = service_weak_.get(); |
| 146 if (!service || service->browser_terminating()) |
| 147 return; |
| 148 |
| 145 source_file_ = source_file; | 149 source_file_ = source_file; |
| 146 | 150 |
| 147 scoped_refptr<SandboxedUnpacker> unpacker( | 151 scoped_refptr<SandboxedUnpacker> unpacker( |
| 148 new SandboxedUnpacker(source_file, | 152 new SandboxedUnpacker(source_file, |
| 149 content::ResourceDispatcherHost::Get() != NULL, | |
| 150 install_source_, | 153 install_source_, |
| 151 creation_flags_, | 154 creation_flags_, |
| 152 install_directory_, | 155 install_directory_, |
| 153 installer_task_runner_.get(), | 156 installer_task_runner_.get(), |
| 154 this)); | 157 this)); |
| 155 | 158 |
| 156 if (!installer_task_runner_->PostTask( | 159 if (!installer_task_runner_->PostTask( |
| 157 FROM_HERE, | 160 FROM_HERE, |
| 158 base::Bind(&SandboxedUnpacker::Start, unpacker.get()))) | 161 base::Bind(&SandboxedUnpacker::Start, unpacker.get()))) |
| 159 NOTREACHED(); | 162 NOTREACHED(); |
| (...skipping 626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 786 if (!prefs->DidExtensionEscalatePermissions(extension()->id())) | 789 if (!prefs->DidExtensionEscalatePermissions(extension()->id())) |
| 787 return; | 790 return; |
| 788 | 791 |
| 789 if (client_) { | 792 if (client_) { |
| 790 AddRef(); // Balanced in InstallUIProceed() and InstallUIAbort(). | 793 AddRef(); // Balanced in InstallUIProceed() and InstallUIAbort(). |
| 791 client_->ConfirmReEnable(this, extension()); | 794 client_->ConfirmReEnable(this, extension()); |
| 792 } | 795 } |
| 793 } | 796 } |
| 794 | 797 |
| 795 } // namespace extensions | 798 } // namespace extensions |
| OLD | NEW |