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

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

Issue 322893002: Cleanup: Make ExtensionService::OnExtensionInstalled take a bitmask instead of (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more win compile fixes Created 6 years, 6 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
« no previous file with comments | « chrome/browser/extensions/crx_installer.h ('k') | chrome/browser/extensions/extension_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/crx_installer.cc
diff --git a/chrome/browser/extensions/crx_installer.cc b/chrome/browser/extensions/crx_installer.cc
index 7503b973cad7e3436bc3616458bcf1a5b1d343fe..aedc100b3e2e5abcbb5a7be9949fe0eb15baab85 100644
--- a/chrome/browser/extensions/crx_installer.cc
+++ b/chrome/browser/extensions/crx_installer.cc
@@ -44,6 +44,7 @@
#include "content/public/browser/user_metrics.h"
#include "extensions/browser/extension_prefs.h"
#include "extensions/browser/extension_system.h"
+#include "extensions/browser/install_flag.h"
#include "extensions/common/extension_icon_set.h"
#include "extensions/common/feature_switch.h"
#include "extensions/common/file_util.h"
@@ -130,11 +131,8 @@ CrxInstaller::CrxInstaller(base::WeakPtr<ExtensionService> service_weak,
off_store_install_allow_reason_(OffStoreInstallDisallowed),
did_handle_successfully_(true),
error_on_unsupported_requirements_(false),
- has_requirement_errors_(false),
- blacklist_state_(extensions::NOT_BLACKLISTED),
- install_wait_for_idle_(true),
update_from_settings_page_(false),
- is_ephemeral_(false),
+ install_flags_(kInstallFlagNone),
installer_(service_weak->profile()) {
installer_task_runner_ = service_weak->GetFileTaskRunner();
if (!approval)
@@ -164,7 +162,7 @@ CrxInstaller::CrxInstaller(base::WeakPtr<ExtensionService> service_weak,
}
show_dialog_callback_ = approval->show_dialog_callback;
- is_ephemeral_ = approval->is_ephemeral;
+ set_is_ephemeral(approval->is_ephemeral);
}
CrxInstaller::~CrxInstaller() {
@@ -528,7 +526,7 @@ void CrxInstaller::OnRequirementsChecked(
base::UTF8ToUTF16(JoinString(requirement_errors, ' '))));
return;
}
- has_requirement_errors_ = true;
+ install_flags_ |= kInstallFlagHasRequirementErrors;
}
ExtensionSystem::Get(profile())->blacklist()->IsBlacklisted(
@@ -542,10 +540,12 @@ void CrxInstaller::OnBlacklistChecked(
if (!service_weak_)
return;
- blacklist_state_ = blacklist_state;
+ if (blacklist_state == extensions::BLACKLISTED_MALWARE) {
+ install_flags_ |= kInstallFlagIsBlacklistedForMalware;
+ }
- if ((blacklist_state_ == extensions::BLACKLISTED_MALWARE ||
- blacklist_state_ == extensions::BLACKLISTED_UNKNOWN) &&
+ if ((blacklist_state == extensions::BLACKLISTED_MALWARE ||
+ blacklist_state == extensions::BLACKLISTED_UNKNOWN) &&
!allow_silent_install_) {
// User tried to install a blacklisted extension. Show an error and
// refuse to install it.
@@ -817,12 +817,8 @@ void CrxInstaller::ReportSuccessFromUIThread() {
}
}
- service_weak_->OnExtensionInstalled(extension(),
- page_ordinal_,
- has_requirement_errors_,
- blacklist_state_,
- is_ephemeral_,
- install_wait_for_idle_);
+ service_weak_->OnExtensionInstalled(
+ extension(), page_ordinal_, install_flags_);
NotifyCrxInstallComplete(true);
}
« no previous file with comments | « chrome/browser/extensions/crx_installer.h ('k') | chrome/browser/extensions/extension_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698