Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4138)

Unified Diff: chrome/browser/automation/testing_automation_provider_chromeos.cc

Issue 8467012: Refactor proxy handling for ChromeOS to not go through the CrosSettings interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Centralized the proxy change notification. Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 bdfb53167a9e898f5ed409e6ab899e56bb33dd76..39537e15ef4d49732edce620e3d475fccdc6d0cc 100644
--- a/chrome/browser/automation/testing_automation_provider_chromeos.cc
+++ b/chrome/browser/automation/testing_automation_provider_chromeos.cc
@@ -26,7 +26,7 @@
#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/proxy_cros_settings_parser.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,20 +68,23 @@ DictionaryValue* GetNetworkInfoDict(const chromeos::Network* network) {
return item;
}
-Value* GetProxySetting(Browser* browser, const std::string& setting_name) {
- chromeos::ProxyCrosSettingsProvider settings_provider(browser->profile());
+base::Value* GetProxySetting(Browser* browser,
+ 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;
+ base::Value* value;
+ if (chromeos::ProxyCrosSettingsParser::GetProxyPrefValue(
+ browser->profile(), setting_path, &value)) {
Mattias Nissler (ping if slow) 2011/11/08 09:25:22 +4 indentation
pastarmovj 2011/11/09 17:51:53 Done.
+ return value;
+ }
} else {
- Value* setting;
- if (settings_provider.Get(setting_path, &setting)) {
+ base::Value* setting;
+ if (chromeos::ProxyCrosSettingsParser::GetProxyPrefValue(
+ browser->profile(), setting_path, &setting)) {
DictionaryValue* setting_dict = static_cast<DictionaryValue*>(setting);
- Value* value;
+ base::Value* value;
bool found = setting_dict->Remove("value", &value);
delete setting;
if (found)
@@ -468,7 +471,7 @@ void TestingAutomationProvider::GetNetworkInfo(DictionaryValue* args,
remembered_wifi.begin(); iter != remembered_wifi.end();
++iter) {
const chromeos::WifiNetwork* wifi = *iter;
- items->Append(Value::CreateStringValue(wifi->service_path()));
+ items->Append(base::Value::CreateStringValue(wifi->service_path()));
}
return_value->Set("remembered_wifi", items);
@@ -527,10 +530,9 @@ void TestingAutomationProvider::GetProxySettings(Browser* browser,
"socks", "socksport", "ignorelist" };
scoped_ptr<DictionaryValue> return_value(new DictionaryValue);
- chromeos::ProxyCrosSettingsProvider settings_provider(browser->profile());
for (size_t i = 0; i < arraysize(settings); ++i) {
- Value* setting = GetProxySetting(browser, settings[i]);
+ base::Value* setting = GetProxySetting(browser, settings[i]);
if (setting)
return_value->Set(settings[i], setting);
}
@@ -543,7 +545,7 @@ void TestingAutomationProvider::SetProxySettings(Browser* browser,
IPC::Message* reply_message) {
AutomationJSONReply reply(this, reply_message);
std::string key;
- Value* value;
+ base::Value* value;
if (!args->GetString("key", &key) || !args->Get("value", &value)) {
reply.SendError("Invalid or missing args.");
return;
@@ -553,8 +555,8 @@ void TestingAutomationProvider::SetProxySettings(Browser* browser,
setting_path.append(key);
// ProxyCrosSettingsProvider will own the Value* passed to Set().
- chromeos::ProxyCrosSettingsProvider(browser->profile()).Set(setting_path,
- value->DeepCopy());
+ chromeos::ProxyCrosSettingsParser::SetProxyPrefValue(
+ browser->profile(), setting_path, value);
reply.SendSuccess(NULL);
}

Powered by Google App Engine
This is Rietveld 408576698