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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 | 163 |
164 CrxInstaller::~CrxInstaller() { | 164 CrxInstaller::~CrxInstaller() { |
165 // Make sure the UI is deleted on the ui thread. | 165 // Make sure the UI is deleted on the ui thread. |
166 if (client_) { | 166 if (client_) { |
167 BrowserThread::DeleteSoon(BrowserThread::UI, FROM_HERE, client_); | 167 BrowserThread::DeleteSoon(BrowserThread::UI, FROM_HERE, client_); |
168 client_ = NULL; | 168 client_ = NULL; |
169 } | 169 } |
170 } | 170 } |
171 | 171 |
172 void CrxInstaller::InstallCrx(const base::FilePath& source_file) { | 172 void CrxInstaller::InstallCrx(const base::FilePath& source_file) { |
| 173 InstallCrxFile(CRXFileInfo(source_file)); |
| 174 } |
| 175 |
| 176 void CrxInstaller::InstallCrxFile(const CRXFileInfo& source_file) { |
173 ExtensionService* service = service_weak_.get(); | 177 ExtensionService* service = service_weak_.get(); |
174 if (!service || service->browser_terminating()) | 178 if (!service || service->browser_terminating()) |
175 return; | 179 return; |
176 | 180 |
177 NotifyCrxInstallBegin(); | 181 NotifyCrxInstallBegin(); |
178 | 182 |
179 source_file_ = source_file; | 183 source_file_ = source_file.path; |
180 | 184 |
181 scoped_refptr<SandboxedUnpacker> unpacker( | 185 scoped_refptr<SandboxedUnpacker> unpacker( |
182 new SandboxedUnpacker(source_file, | 186 new SandboxedUnpacker(source_file, |
183 install_source_, | 187 install_source_, |
184 creation_flags_, | 188 creation_flags_, |
185 install_directory_, | 189 install_directory_, |
186 installer_task_runner_.get(), | 190 installer_task_runner_.get(), |
187 this)); | 191 this)); |
188 | 192 |
189 if (!installer_task_runner_->PostTask( | 193 if (!installer_task_runner_->PostTask( |
(...skipping 724 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
914 if (!prefs->DidExtensionEscalatePermissions(extension()->id())) | 918 if (!prefs->DidExtensionEscalatePermissions(extension()->id())) |
915 return; | 919 return; |
916 | 920 |
917 if (client_) { | 921 if (client_) { |
918 AddRef(); // Balanced in InstallUIProceed() and InstallUIAbort(). | 922 AddRef(); // Balanced in InstallUIProceed() and InstallUIAbort(). |
919 client_->ConfirmReEnable(this, extension()); | 923 client_->ConfirmReEnable(this, extension()); |
920 } | 924 } |
921 } | 925 } |
922 | 926 |
923 } // namespace extensions | 927 } // namespace extensions |
OLD | NEW |