Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1538)

Unified Diff: chrome/browser/extensions/extension_service.cc

Issue 9595001: Apps on NTP should be in order of installation (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: More fixes Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/extension_service.cc
diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc
index 891290ec703224a9131bc337c81a99f43b6427e5..4b39991012069b2e4e31a23f65b7dc0e58342372 100644
--- a/chrome/browser/extensions/extension_service.cc
+++ b/chrome/browser/extensions/extension_service.cc
@@ -615,13 +615,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
@@ -638,16 +637,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 was installed from or has migrated to the webstore, or
// if the extension came from sync and its auto-update URL is from the
@@ -657,9 +656,9 @@ bool ExtensionService::UpdateExtension(
int creation_flags = Extension::NO_FLAGS;
if ((extension && extension->from_webstore()) ||
(extension && extension->UpdatesFromGallery()) ||
- (!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;
}
@@ -2185,11 +2184,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 = NULL;
+ 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()
« no previous file with comments | « no previous file | chrome/browser/extensions/pending_extension_info.h » ('j') | chrome/browser/extensions/pending_extension_info.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698