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

Unified Diff: components/update_client/action.cc

Issue 2206583007: Handle the case when the updates are disabled for a component. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 4 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 | « components/update_client/action.h ('k') | components/update_client/test_configurator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/update_client/action.cc
diff --git a/components/update_client/action.cc b/components/update_client/action.cc
index 061dd220598e1465037066366f246773856ff328..cb9d738b3ef06c117d30f8fab1b151d9970e7e96 100644
--- a/components/update_client/action.cc
+++ b/components/update_client/action.cc
@@ -127,6 +127,19 @@ void ActionImpl::UpdateCrx() {
item->update_begin = base::TimeTicks::Now();
+ if (item->component.supports_group_policy_enable_component_updates &&
+ !update_context_->config->EnabledComponentUpdates()) {
+ item->error_category =
+ static_cast<int>(Action::ErrorCategory::kServiceError);
+ item->error_code =
+ static_cast<int>(Action::ServiceError::ERROR_UPDATE_DISABLED);
+ item->extra_code1 = 0;
+ ChangeItemState(item, CrxUpdateItem::State::kNoUpdate);
+
+ UpdateCrxComplete(item);
+ return;
+ }
+
std::unique_ptr<Action> update_action(
CanTryDiffUpdate(item, update_context_->config)
? ActionUpdateDiff::Create()
« no previous file with comments | « components/update_client/action.h ('k') | components/update_client/test_configurator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698