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

Unified Diff: chrome/browser/policy/policy_loader_mac.cc

Issue 14294008: Add UMA histograms for policy loading. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix nit Created 7 years, 8 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 | « chrome/browser/policy/policy_load_status.cc ('k') | chrome/browser/policy/policy_loader_win.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/policy/policy_loader_mac.cc
diff --git a/chrome/browser/policy/policy_loader_mac.cc b/chrome/browser/policy/policy_loader_mac.cc
index 317ea14491fa9aab2270b5684f9c338b23bc2587..291063b620acbb83c2f345ed5e28b1fafe13c7fc 100644
--- a/chrome/browser/policy/policy_loader_mac.cc
+++ b/chrome/browser/policy/policy_loader_mac.cc
@@ -16,6 +16,7 @@
#include "base/strings/sys_string_conversions.h"
#include "base/values.h"
#include "chrome/browser/policy/policy_bundle.h"
+#include "chrome/browser/policy/policy_load_status.h"
#include "chrome/browser/policy/policy_map.h"
#include "chrome/browser/policy/preferences_mac.h"
#include "chrome/common/chrome_paths.h"
@@ -99,6 +100,8 @@ scoped_ptr<PolicyBundle> PolicyLoaderMac::Load() {
PolicyMap& chrome_policy =
bundle->Get(PolicyNamespace(POLICY_DOMAIN_CHROME, std::string()));
+ PolicyLoadStatusSample status;
+ bool policy_present = false;
const PolicyDefinitionList::Entry* current;
for (current = policy_list_->begin; current != policy_list_->end; ++current) {
base::mac::ScopedCFTypeRef<CFStringRef> name(
@@ -107,6 +110,7 @@ scoped_ptr<PolicyBundle> PolicyLoaderMac::Load() {
preferences_->CopyAppValue(name, kCFPreferencesCurrentApplication));
if (!value.get())
continue;
+ policy_present = true;
bool forced =
preferences_->AppValueIsForced(name, kCFPreferencesCurrentApplication);
PolicyLevel level = forced ? POLICY_LEVEL_MANDATORY :
@@ -115,8 +119,13 @@ scoped_ptr<PolicyBundle> PolicyLoaderMac::Load() {
base::Value* policy = CreateValueFromProperty(value);
if (policy)
chrome_policy.Set(current->name, level, POLICY_SCOPE_USER, policy);
+ else
+ status.Add(POLICY_LOAD_STATUS_PARSE_ERROR);
}
+ if (!policy_present)
+ status.Add(POLICY_LOAD_STATUS_NO_POLICY);
+
return bundle.Pass();
}
« no previous file with comments | « chrome/browser/policy/policy_load_status.cc ('k') | chrome/browser/policy/policy_loader_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698