| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "base/json/json_reader.h" | 5 #include "base/json/json_reader.h" |
| 6 #include "base/prefs/pref_service.h" | 6 #include "base/prefs/pref_service.h" |
| 7 #include "chrome/browser/browser_process.h" | 7 #include "chrome/browser/browser_process.h" |
| 8 #include "chrome/browser/extensions/api/settings_private/prefs_util.h" | 8 #include "chrome/browser/extensions/api/settings_private/prefs_util.h" |
| 9 #include "chrome/browser/extensions/chrome_extension_function.h" | 9 #include "chrome/browser/extensions/chrome_extension_function.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| 11 #include "chrome/common/pref_names.h" | 11 #include "chrome/common/pref_names.h" |
| 12 #include "components/url_fixer/url_fixer.h" | 12 #include "components/url_formatter/url_fixer.h" |
| 13 | 13 |
| 14 #if defined(OS_CHROMEOS) | 14 #if defined(OS_CHROMEOS) |
| 15 #include "chrome/browser/chromeos/ownership/owner_settings_service_chromeos.h" | 15 #include "chrome/browser/chromeos/ownership/owner_settings_service_chromeos.h" |
| 16 #include "chrome/browser/chromeos/ownership/owner_settings_service_chromeos_fact
ory.h" | 16 #include "chrome/browser/chromeos/ownership/owner_settings_service_chromeos_fact
ory.h" |
| 17 #include "chrome/browser/chromeos/settings/cros_settings.h" | 17 #include "chrome/browser/chromeos/settings/cros_settings.h" |
| 18 #endif | 18 #endif |
| 19 | 19 |
| 20 namespace extensions { | 20 namespace extensions { |
| 21 | 21 |
| 22 namespace settings_private = api::settings_private; | 22 namespace settings_private = api::settings_private; |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 temp_value.reset(new base::FundamentalValue(int_value)); | 208 temp_value.reset(new base::FundamentalValue(int_value)); |
| 209 value = temp_value.get(); | 209 value = temp_value.get(); |
| 210 break; | 210 break; |
| 211 } | 211 } |
| 212 case base::Value::TYPE_STRING: { | 212 case base::Value::TYPE_STRING: { |
| 213 std::string original; | 213 std::string original; |
| 214 if (!value->GetAsString(&original)) | 214 if (!value->GetAsString(&original)) |
| 215 return false; | 215 return false; |
| 216 | 216 |
| 217 if (IsPrefTypeURL(pref_name)) { | 217 if (IsPrefTypeURL(pref_name)) { |
| 218 GURL fixed = url_fixer::FixupURL(original, std::string()); | 218 GURL fixed = url_formatter::FixupURL(original, std::string()); |
| 219 temp_value.reset(new base::StringValue(fixed.spec())); | 219 temp_value.reset(new base::StringValue(fixed.spec())); |
| 220 value = temp_value.get(); | 220 value = temp_value.get(); |
| 221 } | 221 } |
| 222 break; | 222 break; |
| 223 } | 223 } |
| 224 case base::Value::TYPE_LIST: { | 224 case base::Value::TYPE_LIST: { |
| 225 // In case we have a List pref we got a JSON string. | 225 // In case we have a List pref we got a JSON string. |
| 226 std::string json_string; | 226 std::string json_string; |
| 227 if (!value->GetAsString(&json_string)) | 227 if (!value->GetAsString(&json_string)) |
| 228 return false; | 228 return false; |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 360 | 360 |
| 361 bool PrefsUtil::IsCrosSetting(const std::string& pref_name) { | 361 bool PrefsUtil::IsCrosSetting(const std::string& pref_name) { |
| 362 #if defined(OS_CHROMEOS) | 362 #if defined(OS_CHROMEOS) |
| 363 return CrosSettings::Get()->IsCrosSettings(pref_name); | 363 return CrosSettings::Get()->IsCrosSettings(pref_name); |
| 364 #else | 364 #else |
| 365 return false; | 365 return false; |
| 366 #endif | 366 #endif |
| 367 } | 367 } |
| 368 | 368 |
| 369 } // namespace extensions | 369 } // namespace extensions |
| OLD | NEW |