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

Unified Diff: chrome/browser/component_updater/supervised_user_whitelist_installer.cc

Issue 879993005: Add support for uninstalling components and use it in SupervisedUserWhitelistInstaller. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: rebase Created 5 years, 10 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/component_updater/supervised_user_whitelist_installer.cc
diff --git a/chrome/browser/component_updater/supervised_user_whitelist_installer.cc b/chrome/browser/component_updater/supervised_user_whitelist_installer.cc
index 55b08602d7840b1c1e6a0651225190aaa467295b..49b55c3037bb6182288ed28348031ea852fc8482 100644
--- a/chrome/browser/component_updater/supervised_user_whitelist_installer.cc
+++ b/chrome/browser/component_updater/supervised_user_whitelist_installer.cc
@@ -121,9 +121,10 @@ class SupervisedUserWhitelistInstallerImpl
const std::string& name,
bool newly_added,
const WhitelistReadyCallback& callback) override;
- void UnregisterWhitelist(const std::string& crx_id) override;
+ void UninstallWhitelist(const std::string& crx_id) override;
ComponentUpdateService* cus_;
+ std::map<std::string, scoped_refptr<DefaultComponentInstaller>> installers_;
};
SupervisedUserWhitelistInstallerImpl::SupervisedUserWhitelistInstallerImpl(
@@ -144,14 +145,18 @@ void SupervisedUserWhitelistInstallerImpl::RegisterWhitelist(
installer->Register(cus_);
+ installers_[crx_id] = installer;
Sorin Jianu 2015/02/05 22:55:35 Do we have many crx ids associated with this produ
Bernhard Bauer 2015/02/05 23:57:34 Yeah, there can be multiple whitelists, each with
Sorin Jianu 2015/02/06 00:22:04 Do we have an idea about how many whitelists are w
Bernhard Bauer 2015/02/06 16:05:05 The design doc is at go/unichrome-whitelists-clank
+
if (newly_added)
TriggerComponentUpdate(&cus_->GetOnDemandUpdater(), crx_id);
}
-void SupervisedUserWhitelistInstallerImpl::UnregisterWhitelist(
- const std::string& id) {
- // TODO(bauerb): Implement!
- NOTIMPLEMENTED();
+void SupervisedUserWhitelistInstallerImpl::UninstallWhitelist(
+ const std::string& crx_id) {
+ auto it = installers_.find(crx_id);
+ DCHECK(it != installers_.end());
+ it->second->Unregister(cus_);
+ installers_.erase(it);
}
} // namespace

Powered by Google App Engine
This is Rietveld 408576698