OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/unpacked_installer.h" | 5 #include "chrome/browser/extensions/unpacked_installer.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "chrome/browser/extensions/extension_install_ui.h" | 10 #include "chrome/browser/extensions/extension_install_ui.h" |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 if (!service_weak_.get()) | 187 if (!service_weak_.get()) |
188 return; | 188 return; |
189 service_weak_->ReportExtensionLoadError(extension_path_, error, true); | 189 service_weak_->ReportExtensionLoadError(extension_path_, error, true); |
190 } | 190 } |
191 | 191 |
192 void UnpackedInstaller::OnLoaded( | 192 void UnpackedInstaller::OnLoaded( |
193 const scoped_refptr<const Extension>& extension) { | 193 const scoped_refptr<const Extension>& extension) { |
194 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 194 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
195 if (!service_weak_.get()) | 195 if (!service_weak_.get()) |
196 return; | 196 return; |
197 const ExtensionList* disabled_extensions = | 197 const ExtensionSet* disabled_extensions = |
198 service_weak_->disabled_extensions(); | 198 service_weak_->disabled_extensions(); |
199 if (service_weak_->show_extensions_prompts() && | 199 if (service_weak_->show_extensions_prompts() && |
200 prompt_for_plugins_ && | 200 prompt_for_plugins_ && |
201 !extension->plugins().empty() && | 201 !extension->plugins().empty() && |
202 std::find(disabled_extensions->begin(), | 202 disabled_extensions->Contains(extension->id())) { |
203 disabled_extensions->end(), | |
204 extension) != | |
205 disabled_extensions->end()) { | |
206 SimpleExtensionLoadPrompt* prompt = new SimpleExtensionLoadPrompt( | 203 SimpleExtensionLoadPrompt* prompt = new SimpleExtensionLoadPrompt( |
207 service_weak_->profile(), | 204 service_weak_->profile(), |
208 service_weak_, | 205 service_weak_, |
209 extension); | 206 extension); |
210 prompt->ShowPrompt(); | 207 prompt->ShowPrompt(); |
211 return; // continues in SimpleExtensionLoadPrompt::InstallUI* | 208 return; // continues in SimpleExtensionLoadPrompt::InstallUI* |
212 } | 209 } |
213 service_weak_->OnExtensionInstalled(extension, | 210 service_weak_->OnExtensionInstalled(extension, |
214 false, // Not from web store. | 211 false, // Not from web store. |
215 -1); | 212 -1); |
216 } | 213 } |
217 | 214 |
218 } // namespace extensions | 215 } // namespace extensions |
OLD | NEW |