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

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

Issue 2440473004: Add policy domain for signin screen apps (Closed)
Patch Set: More comments according to feedback 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 f5370c7219ef00ccc29124a046f3547c8758f256..f726c06dceb47d6acff4934e2649e5f9975880a8 100644
--- a/components/policy/core/common/schema_registry.cc
+++ b/components/policy/core/common/schema_registry.cc
@@ -16,7 +16,7 @@ SchemaRegistry::SchemaRegistry() : schema_map_(new SchemaMap) {
for (int i = 0; i < POLICY_DOMAIN_SIZE; ++i)
domains_ready_[i] = false;
#if !defined(ENABLE_EXTENSIONS)
- domains_ready_[POLICY_DOMAIN_EXTENSIONS] = true;
+ SetExtensionsDomainsReady();
#endif
}
@@ -76,6 +76,16 @@ void SchemaRegistry::SetReady(PolicyDomain domain) {
}
}
+void SchemaRegistry::SetAllDomainsReady() {
+ for (int i = 0; i < POLICY_DOMAIN_SIZE; ++i)
+ SetReady(static_cast<PolicyDomain>(i));
+}
+
+void SchemaRegistry::SetExtensionsDomainsReady() {
+ SetReady(POLICY_DOMAIN_EXTENSIONS);
+ SetReady(POLICY_DOMAIN_SIGNIN_EXTENSIONS);
+}
+
void SchemaRegistry::AddObserver(Observer* observer) {
observers_.AddObserver(observer);
}
@@ -102,8 +112,7 @@ CombinedSchemaRegistry::CombinedSchemaRegistry()
// The combined registry is always ready, since it can always start tracking
// another registry that is not ready yet and going from "ready" to "not
// ready" is not allowed.
- for (int i = 0; i < POLICY_DOMAIN_SIZE; ++i)
- SetReady(static_cast<PolicyDomain>(i));
+ SetAllDomainsReady();
}
CombinedSchemaRegistry::~CombinedSchemaRegistry() {}

Powered by Google App Engine
This is Rietveld 408576698