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 ExtensionSet* disabled_extensions = | 197 const ExtensionList* 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 disabled_extensions->Contains(extension->id())) { | 202 std::find(disabled_extensions->begin(), |
| 203 disabled_extensions->end(), |
| 204 extension) != |
| 205 disabled_extensions->end()) { |
203 SimpleExtensionLoadPrompt* prompt = new SimpleExtensionLoadPrompt( | 206 SimpleExtensionLoadPrompt* prompt = new SimpleExtensionLoadPrompt( |
204 service_weak_->profile(), | 207 service_weak_->profile(), |
205 service_weak_, | 208 service_weak_, |
206 extension); | 209 extension); |
207 prompt->ShowPrompt(); | 210 prompt->ShowPrompt(); |
208 return; // continues in SimpleExtensionLoadPrompt::InstallUI* | 211 return; // continues in SimpleExtensionLoadPrompt::InstallUI* |
209 } | 212 } |
210 service_weak_->OnExtensionInstalled(extension, | 213 service_weak_->OnExtensionInstalled(extension, |
211 false, // Not from web store. | 214 false, // Not from web store. |
212 -1); | 215 -1); |
213 } | 216 } |
214 | 217 |
215 } // namespace extensions | 218 } // namespace extensions |
OLD | NEW |