Chromium Code Reviews| Index: chrome/browser/extensions/extension_service.cc |
| diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc |
| index 4a27f8c512b5196a77f8a552e57cb3c2c281a1a8..9de0e293f416c82ba2d78281d75d05d252b4a8f5 100644 |
| --- a/chrome/browser/extensions/extension_service.cc |
| +++ b/chrome/browser/extensions/extension_service.cc |
| @@ -611,13 +611,12 @@ bool ExtensionService::UpdateExtension( |
| CrxInstaller** out_crx_installer) { |
| CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| - PendingExtensionInfo pending_extension_info; |
| - bool is_pending_extension = pending_extension_manager_.GetById( |
| - id, &pending_extension_info); |
| + const PendingExtensionInfo* pending_extension_info = |
| + pending_extension_manager()->GetById(id); |
| const Extension* extension = |
| GetExtensionByIdInternal(id, true, true, false); |
| - if (!is_pending_extension && !extension) { |
| + if (!pending_extension_info && !extension) { |
| LOG(WARNING) << "Will not update extension " << id |
| << " because it is not installed or pending"; |
| // Delete extension_path since we're not creating a CrxInstaller |
| @@ -634,16 +633,16 @@ bool ExtensionService::UpdateExtension( |
| // We want a silent install only for non-pending extensions and |
| // pending extensions that have install_silently set. |
| ExtensionInstallUI* client = |
| - (!is_pending_extension || pending_extension_info.install_silently()) ? |
| + (!pending_extension_info || pending_extension_info->install_silently()) ? |
| NULL : new ExtensionInstallUI(profile_); |
| scoped_refptr<CrxInstaller> installer(CrxInstaller::Create(this, client)); |
| installer->set_expected_id(id); |
| - if (is_pending_extension) |
| - installer->set_install_source(pending_extension_info.install_source()); |
| + if (pending_extension_info) |
| + installer->set_install_source(pending_extension_info->install_source()); |
| else if (extension) |
| installer->set_install_source(extension->location()); |
| - if (pending_extension_info.install_silently()) |
| + if (pending_extension_info->install_silently()) |
| installer->set_allow_silent_install(true); |
| // If the extension came from sync and its auto-update URL is from the |
| // webstore, treat it as a webstore install. Note that we ignore some older |
| @@ -651,9 +650,9 @@ bool ExtensionService::UpdateExtension( |
| // with restrictions on NaCl extensions, which are newer. |
| int creation_flags = Extension::NO_FLAGS; |
| if ((extension && extension->from_webstore()) || |
| - (!extension && pending_extension_info.is_from_sync() && |
| + (!extension && pending_extension_info->is_from_sync() && |
| extension_urls::IsWebstoreUpdateUrl( |
| - pending_extension_info.update_url()))) { |
| + pending_extension_info->update_url()))) { |
| creation_flags |= Extension::FROM_WEBSTORE; |
| } |
| @@ -2189,11 +2188,11 @@ void ExtensionService::OnExtensionInstalled( |
| bool initial_enable = |
| !extension_prefs_->IsExtensionDisabled(id) || |
| !Extension::UserMayDisable(extension->location()); |
| - PendingExtensionInfo pending_extension_info; |
| - if (pending_extension_manager()->GetById(id, &pending_extension_info)) { |
| + const PendingExtensionInfo* pending_extension_info; |
|
Aaron Boodman
2012/04/09 17:02:14
= NULL
mitchellwrosen
2012/04/13 22:20:18
Done.
|
| + if ((pending_extension_info = pending_extension_manager()->GetById(id))) { |
| pending_extension_manager()->Remove(id); |
| - if (!pending_extension_info.ShouldAllowInstall(*extension)) { |
| + if (!pending_extension_info->ShouldAllowInstall(*extension)) { |
| LOG(WARNING) |
| << "ShouldAllowInstall() returned false for " |
| << id << " of type " << extension->GetType() |