<commit_before>// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/policy/configuration_policy_provider.h"

#include "base/values.h"
#include "chrome/common/policy_constants.h"
#include "chrome/common/notification_service.h"

namespace {

// TODO(avi): Use this mapping to auto-generate MCX manifests and Windows
// ADM/ADMX files. http://crbug.com/49316

struct InternalPolicyValueMapEntry {
  ConfigurationPolicyStore::PolicyType policy_type;
  Value::ValueType value_type;
  const char* name;
};

const InternalPolicyValueMapEntry kPolicyValueMap[] = {
  { ConfigurationPolicyStore::kPolicyHomePage,
      Value::TYPE_STRING, policy::key::kHomepageLocation },
  { ConfigurationPolicyStore::kPolicyHomepageIsNewTabPage,
      Value::TYPE_BOOLEAN, policy::key::kHomepageIsNewTabPage },
  { ConfigurationPolicyStore::kPolicyRestoreOnStartup,
      Value::TYPE_INTEGER, policy::key::kRestoreOnStartup },
  { ConfigurationPolicyStore::kPolicyURLsToRestoreOnStartup,
      Value::TYPE_LIST, policy::key::kURLsToRestoreOnStartup },
  { ConfigurationPolicyStore::kPolicyProxyServerMode,
      Value::TYPE_INTEGER, policy::key::kProxyServerMode },
  { ConfigurationPolicyStore::kPolicyProxyServer,
      Value::TYPE_STRING, policy::key::kProxyServer },
  { ConfigurationPolicyStore::kPolicyProxyPacUrl,
      Value::TYPE_STRING, policy::key::kProxyPacUrl },
  { ConfigurationPolicyStore::kPolicyProxyBypassList,
      Value::TYPE_STRING, policy::key::kProxyBypassList },
  { ConfigurationPolicyStore::kPolicyAlternateErrorPagesEnabled,
      Value::TYPE_BOOLEAN, policy::key::kAlternateErrorPagesEnabled },
  { ConfigurationPolicyStore::kPolicySearchSuggestEnabled,
      Value::TYPE_BOOLEAN, policy::key::kSearchSuggestEnabled },
  { ConfigurationPolicyStore::kPolicyDnsPrefetchingEnabled,
      Value::TYPE_BOOLEAN, policy::key::kDnsPrefetchingEnabled },
  { ConfigurationPolicyStore::kPolicySafeBrowsingEnabled,<commit_msg>Update bug reference.<commit_after>// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/policy/configuration_policy_provider.h"

#include "base/values.h"
#include "chrome/common/policy_constants.h"
#include "chrome/common/notification_service.h"

namespace {

// TODO(avi): Generate this mapping from the template metafile
// (chrome/app/policy/policy_templates.json). http://crbug.com/54711

struct InternalPolicyValueMapEntry {
  ConfigurationPolicyStore::PolicyType policy_type;
  Value::ValueType value_type;
  const char* name;
};

const InternalPolicyValueMapEntry kPolicyValueMap[] = {
  { ConfigurationPolicyStore::kPolicyHomePage,
      Value::TYPE_STRING, policy::key::kHomepageLocation },
  { ConfigurationPolicyStore::kPolicyHomepageIsNewTabPage,
      Value::TYPE_BOOLEAN, policy::key::kHomepageIsNewTabPage },
  { ConfigurationPolicyStore::kPolicyRestoreOnStartup,
      Value::TYPE_INTEGER, policy::key::kRestoreOnStartup },
  { ConfigurationPolicyStore::kPolicyURLsToRestoreOnStartup,
      Value::TYPE_LIST, policy::key::kURLsToRestoreOnStartup },
  { ConfigurationPolicyStore::kPolicyProxyServerMode,
      Value::TYPE_INTEGER, policy::key::kProxyServerMode },
  { ConfigurationPolicyStore::kPolicyProxyServer,
      Value::TYPE_STRING, policy::key::kProxyServer },
  { ConfigurationPolicyStore::kPolicyProxyPacUrl,
      Value::TYPE_STRING, policy::key::kProxyPacUrl },
  { ConfigurationPolicyStore::kPolicyProxyBypassList,
      Value::TYPE_STRING, policy::key::kProxyBypassList },
  { ConfigurationPolicyStore::kPolicyAlternateErrorPagesEnabled,
      Value::TYPE_BOOLEAN, policy::key::kAlternateErrorPagesEnabled },
  { ConfigurationPolicyStore::kPolicySearchSuggestEnabled,
      Value::TYPE_BOOLEAN, policy::key::kSearchSuggestEnabled },
  { ConfigurationPolicyStore::kPolicyDnsPrefetchingEnabled,
      Value::TYPE_BOOLEAN, policy::key::kDnsPrefetchingEnabled },
  { ConfigurationPolicyStore::kPolicySafeBrowsingEnabled,
{'fraction_non_alphanumeric': 0.10578313253012048, 'fraction_numerical': 0.004337349397590362, 'mean_word_length': 6.846880907372401, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4039353', 'n_tokens_mistral': 1212, 'n_tokens_neox': 1193, 'n_words': 192}