| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/policy/configuration_policy_handler_chromeos.h" | 5 #include "chrome/browser/policy/configuration_policy_handler_chromeos.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/json/json_reader.h" | 9 #include "base/json/json_reader.h" |
| 10 #include "base/json/json_writer.h" | 10 #include "base/json/json_writer.h" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/string_util.h" | 12 #include "base/string_util.h" |
| 13 #include "chrome/browser/chromeos/cros/onc_network_parser.h" | 13 #include "chrome/browser/chromeos/cros/onc_network_parser.h" |
| 14 #include "chrome/browser/policy/policy_error_map.h" | 14 #include "chrome/browser/policy/policy_error_map.h" |
| 15 #include "chrome/browser/policy/policy_map.h" | 15 #include "chrome/browser/policy/policy_map.h" |
| 16 #include "chrome/browser/prefs/pref_value_map.h" | 16 #include "chrome/browser/prefs/pref_value_map.h" |
| 17 #include "chrome/browser/ui/views/ash/launcher/chrome_launcher_controller.h" | 17 #include "chrome/browser/ui/ash/chrome_launcher_prefs.h" |
| 18 #include "chrome/common/pref_names.h" | 18 #include "chrome/common/pref_names.h" |
| 19 #include "grit/generated_resources.h" | 19 #include "grit/generated_resources.h" |
| 20 #include "policy/policy_constants.h" | 20 #include "policy/policy_constants.h" |
| 21 | 21 |
| 22 namespace policy { | 22 namespace policy { |
| 23 | 23 |
| 24 NetworkConfigurationPolicyHandler::NetworkConfigurationPolicyHandler( | 24 NetworkConfigurationPolicyHandler::NetworkConfigurationPolicyHandler( |
| 25 const char* policy_name, | 25 const char* policy_name, |
| 26 chromeos::NetworkUIData::ONCSource onc_source) | 26 chromeos::NetworkUIData::ONCSource onc_source) |
| 27 : TypeCheckingPolicyHandler(policy_name, Value::TYPE_STRING), | 27 : TypeCheckingPolicyHandler(policy_name, Value::TYPE_STRING), |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 PolicyErrorMap errors; | 142 PolicyErrorMap errors; |
| 143 const base::Value* policy_value = policies.GetValue(policy_name()); | 143 const base::Value* policy_value = policies.GetValue(policy_name()); |
| 144 const base::ListValue* policy_list = NULL; | 144 const base::ListValue* policy_list = NULL; |
| 145 if (policy_value && policy_value->GetAsList(&policy_list) && policy_list) { | 145 if (policy_value && policy_value->GetAsList(&policy_list) && policy_list) { |
| 146 base::ListValue* pinned_apps_list = new base::ListValue(); | 146 base::ListValue* pinned_apps_list = new base::ListValue(); |
| 147 for (base::ListValue::const_iterator entry(policy_list->begin()); | 147 for (base::ListValue::const_iterator entry(policy_list->begin()); |
| 148 entry != policy_list->end(); ++entry) { | 148 entry != policy_list->end(); ++entry) { |
| 149 std::string id; | 149 std::string id; |
| 150 if ((*entry)->GetAsString(&id)) { | 150 if ((*entry)->GetAsString(&id)) { |
| 151 base::DictionaryValue* app_dict = new base::DictionaryValue(); | 151 base::DictionaryValue* app_dict = new base::DictionaryValue(); |
| 152 app_dict->SetString(ChromeLauncherController::kPinnedAppsPrefAppIDPath, | 152 app_dict->SetString(ash::kPinnedAppsPrefAppIDPath, id); |
| 153 id); | |
| 154 pinned_apps_list->Append(app_dict); | 153 pinned_apps_list->Append(app_dict); |
| 155 } | 154 } |
| 156 } | 155 } |
| 157 prefs->SetValue(pref_path(), pinned_apps_list); | 156 prefs->SetValue(pref_path(), pinned_apps_list); |
| 158 } | 157 } |
| 159 } | 158 } |
| 160 | 159 |
| 161 } // namespace policy | 160 } // namespace policy |
| OLD | NEW |