Chromium Code Reviews| 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 1fb445f7395c44fd6c9daf1ce3e1709f6aee1de2..50c41ddc6db57eccaa950682ec93aee7c2cac626 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)) { |
|
Mattias Nissler (ping if slow)
2011/09/26 17:26:37
What's the plan for the auto-removal code here? Di
pastarmovj
2011/09/29 15:15:03
We are returning a const pointer to the original d
|
| - 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); |
| } |