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

Unified Diff: components/policy/core/common/schema_registry.cc

Issue 2441653003: Enable fetching of admin policies for login screen apps (Closed)
Patch Set: Rebase Created 4 years, 1 month 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: components/policy/core/common/schema_registry.cc
diff --git a/components/policy/core/common/schema_registry.cc b/components/policy/core/common/schema_registry.cc
index 6482962a51840786e31b19201331da324549932d..03580859d07cd5fc33c2d806f6efadb1261ee422 100644
--- a/components/policy/core/common/schema_registry.cc
+++ b/components/policy/core/common/schema_registry.cc
@@ -199,6 +199,7 @@ ForwardingSchemaRegistry::ForwardingSchemaRegistry(SchemaRegistry* wrapped)
schema_map_ = wrapped_->schema_map();
wrapped_->AddObserver(this);
wrapped_->AddInternalObserver(this);
+ UpdateReadiness();
}
ForwardingSchemaRegistry::~ForwardingSchemaRegistry() {
@@ -230,6 +231,10 @@ void ForwardingSchemaRegistry::OnSchemaRegistryUpdated(bool has_new_schemas) {
Notify(has_new_schemas);
}
+void ForwardingSchemaRegistry::OnSchemaRegistryReady() {
+ UpdateReadiness();
+}
+
void ForwardingSchemaRegistry::OnSchemaRegistryShuttingDown(
SchemaRegistry* registry) {
DCHECK_EQ(wrapped_, registry);
@@ -239,4 +244,9 @@ void ForwardingSchemaRegistry::OnSchemaRegistryShuttingDown(
// Keep serving the same |schema_map_|.
}
+void ForwardingSchemaRegistry::UpdateReadiness() {
+ if (wrapped_->IsReady())
+ SetAllDomainsReady();
+}
+
} // namespace policy
« no previous file with comments | « components/policy/core/common/schema_registry.h ('k') | components/policy/core/common/schema_registry_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698