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

Side by Side Diff: chrome/browser/chromeos/extensions/device_local_account_external_policy_loader.cc

Issue 536573003: Add ExtensionManagement based ExternalLoader (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ext-2
Patch Set: rebase Created 6 years, 3 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/chromeos/policy/device_local_account_extension_tracker.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/chromeos/extensions/device_local_account_external_polic y_loader.h" 5 #include "chrome/browser/chromeos/extensions/device_local_account_external_polic y_loader.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/prefs/pref_value_map.h" 9 #include "base/prefs/pref_value_map.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 } 87 }
88 88
89 DeviceLocalAccountExternalPolicyLoader:: 89 DeviceLocalAccountExternalPolicyLoader::
90 ~DeviceLocalAccountExternalPolicyLoader() { 90 ~DeviceLocalAccountExternalPolicyLoader() {
91 DCHECK(!external_cache_); 91 DCHECK(!external_cache_);
92 } 92 }
93 93
94 void DeviceLocalAccountExternalPolicyLoader::UpdateExtensionListFromStore() { 94 void DeviceLocalAccountExternalPolicyLoader::UpdateExtensionListFromStore() {
95 scoped_ptr<base::DictionaryValue> prefs(new base::DictionaryValue); 95 scoped_ptr<base::DictionaryValue> prefs(new base::DictionaryValue);
96 const policy::PolicyMap& policy_map = store_->policy_map(); 96 const policy::PolicyMap& policy_map = store_->policy_map();
97 // TODO(binjin): Use two policy handlers here after
98 // ExtensionManagementPolicyHandler is introduced.
97 extensions::ExtensionInstallForcelistPolicyHandler policy_handler; 99 extensions::ExtensionInstallForcelistPolicyHandler policy_handler;
98 if (policy_handler.CheckPolicySettings(policy_map, NULL)) { 100 if (policy_handler.CheckPolicySettings(policy_map, NULL)) {
99 PrefValueMap pref_value_map; 101 PrefValueMap pref_value_map;
100 policy_handler.ApplyPolicySettings(policy_map, &pref_value_map); 102 policy_handler.ApplyPolicySettings(policy_map, &pref_value_map);
101 const base::Value* value = NULL; 103 const base::Value* value = NULL;
102 const base::DictionaryValue* dict = NULL; 104 const base::DictionaryValue* dict = NULL;
103 if (pref_value_map.GetValue(extensions::pref_names::kInstallForceList, 105 if (pref_value_map.GetValue(extensions::pref_names::kInstallForceList,
104 &value) && 106 &value) &&
105 value->GetAsDictionary(&dict)) { 107 value->GetAsDictionary(&dict)) {
106 prefs.reset(dict->DeepCopy()); 108 prefs.reset(dict->DeepCopy());
107 } 109 }
108 } 110 }
109 111
110 external_cache_->UpdateExtensionsList(prefs.Pass()); 112 external_cache_->UpdateExtensionsList(prefs.Pass());
111 } 113 }
112 114
113 } // namespace chromeos 115 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/policy/device_local_account_extension_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698