Index: chrome/browser/automation/testing_automation_provider_chromeos.cc |
diff --git a/chrome/browser/automation/testing_automation_provider_chromeos.cc b/chrome/browser/automation/testing_automation_provider_chromeos.cc |
index 25d01719343fca70f05ee26f962375e95b9dfd4a..b462e0ed9cc4bee0f4774436e5a59a2d586f58df 100644 |
--- a/chrome/browser/automation/testing_automation_provider_chromeos.cc |
+++ b/chrome/browser/automation/testing_automation_provider_chromeos.cc |
@@ -13,6 +13,7 @@ |
#include "chrome/browser/automation/automation_provider_observers.h" |
#include "chrome/browser/browser_process.h" |
#include "chrome/browser/chromeos/audio_handler.h" |
+#include "chrome/browser/chromeos/cros_settings.h" |
#include "chrome/browser/chromeos/cros/cros_library.h" |
#include "chrome/browser/chromeos/cros/network_library.h" |
#include "chrome/browser/chromeos/cros/power_library.h" |
@@ -26,7 +27,6 @@ |
#include "chrome/browser/chromeos/login/webui_login_display.h" |
#include "chrome/browser/chromeos/login/wizard_controller.h" |
#include "chrome/browser/chromeos/options/take_photo_dialog.h" |
-#include "chrome/browser/chromeos/proxy_cros_settings_provider.h" |
#include "chrome/browser/chromeos/system/timezone_settings.h" |
#include "chrome/browser/policy/browser_policy_connector.h" |
#include "chrome/browser/policy/cloud_policy_cache_base.h" |
@@ -68,27 +68,11 @@ DictionaryValue* GetNetworkInfoDict(const chromeos::Network* network) { |
return item; |
} |
-Value* GetProxySetting(const std::string& setting_name) { |
- chromeos::ProxyCrosSettingsProvider settings_provider; |
+const Value* GetProxySetting(const std::string& setting_name) { |
std::string setting_path = "cros.session.proxy."; |
setting_path.append(setting_name); |
- if (setting_name == "ignorelist") { |
- Value* value; |
- if (settings_provider.Get(setting_path, &value)) |
- return value; |
- } else { |
- Value* setting; |
- if (settings_provider.Get(setting_path, &setting)) { |
- DictionaryValue* setting_dict = static_cast<DictionaryValue*>(setting); |
- Value* value; |
- bool found = setting_dict->Remove("value", &value); |
- delete setting; |
- if (found) |
- return value; |
- } |
- } |
- return NULL; |
+ return chromeos::CrosSettings::Get()->GetPref(setting_path); |
} |
const char* UpdateStatusToString(chromeos::UpdateStatusOperation status) { |
@@ -524,12 +508,11 @@ void TestingAutomationProvider::GetProxySettings(DictionaryValue* args, |
"socks", "socksport", "ignorelist" }; |
scoped_ptr<DictionaryValue> return_value(new DictionaryValue); |
- chromeos::ProxyCrosSettingsProvider settings_provider; |
for (size_t i = 0; i < arraysize(settings); ++i) { |
- Value* setting = GetProxySetting(settings[i]); |
+ const Value* setting = GetProxySetting(settings[i]); |
if (setting) |
- return_value->Set(settings[i], setting); |
+ return_value->Set(settings[i], setting->DeepCopy()); |
} |
AutomationJSONReply(this, reply_message).SendSuccess(return_value.get()); |
@@ -549,7 +532,7 @@ void TestingAutomationProvider::SetProxySettings(DictionaryValue* args, |
setting_path.append(key); |
// ProxyCrosSettingsProvider will own the Value* passed to Set(). |
- chromeos::ProxyCrosSettingsProvider().Set(setting_path, value->DeepCopy()); |
+ chromeos::CrosSettings::Get()->Set(setting_path, value->DeepCopy()); |
reply.SendSuccess(NULL); |
} |