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

Unified Diff: chrome/browser/extensions/api/storage/managed_value_store_cache.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: chrome/browser/extensions/api/storage/managed_value_store_cache.cc
diff --git a/chrome/browser/extensions/api/storage/managed_value_store_cache.cc b/chrome/browser/extensions/api/storage/managed_value_store_cache.cc
index 1497d9f70933a3fb8510aab46377ea300a407a0a..2864c75d6bf53a25abeb005bb843e68de0ec6d2d 100644
--- a/chrome/browser/extensions/api/storage/managed_value_store_cache.cc
+++ b/chrome/browser/extensions/api/storage/managed_value_store_cache.cc
@@ -39,6 +39,10 @@
#include "extensions/common/manifest_constants.h"
#include "extensions/common/one_shot_event.h"
+#if defined(OS_CHROMEOS)
+#include "chrome/browser/chromeos/profiles/profile_helper.h"
+#endif
+
using content::BrowserContext;
using content::BrowserThread;
@@ -238,7 +242,7 @@ ManagedValueStoreCache::ManagedValueStoreCache(
const scoped_refptr<ValueStoreFactory>& factory,
const scoped_refptr<SettingsObserverList>& observers)
: profile_(Profile::FromBrowserContext(context)),
- policy_domain_(policy::POLICY_DOMAIN_EXTENSIONS),
+ policy_domain_(GetPolicyDomain(profile_)),
policy_service_(
policy::ProfilePolicyConnectorFactory::GetForBrowserContext(context)
->policy_service()),
@@ -331,6 +335,17 @@ void ManagedValueStoreCache::OnPolicyUpdated(const policy::PolicyNamespace& ns,
base::Passed(current.DeepCopy())));
}
+// static
+policy::PolicyDomain ManagedValueStoreCache::GetPolicyDomain(Profile* profile) {
+#if defined(OS_CHROMEOS)
+ return chromeos::ProfileHelper::IsSigninProfile(profile)
+ ? policy::POLICY_DOMAIN_SIGNIN_EXTENSIONS
+ : policy::POLICY_DOMAIN_EXTENSIONS;
+#else
+ return policy::POLICY_DOMAIN_EXTENSIONS;
+#endif
+}
+
void ManagedValueStoreCache::UpdatePolicyOnFILE(
const std::string& extension_id,
std::unique_ptr<policy::PolicyMap> current_policy) {

Powered by Google App Engine
This is Rietveld 408576698