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

Side by Side Diff: chrome/browser/chromeos/net/proxy_config_handler.cc

Issue 1131113004: Convert JsonWriter::Write to taking a const ref for the in-param (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: another rebase Created 5 years, 7 months 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/chromeos/net/proxy_config_handler.h" 5 #include "chrome/browser/chromeos/net/proxy_config_handler.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/json/json_writer.h" 8 #include "base/json/json_writer.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/prefs/pref_registry_simple.h" 10 #include "base/prefs/pref_registry_simple.h"
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 shill_service_client->ClearProperty( 105 shill_service_client->ClearProperty(
106 dbus::ObjectPath(network.path()), 106 dbus::ObjectPath(network.path()),
107 shill::kProxyConfigProperty, 107 shill::kProxyConfigProperty,
108 base::Bind(&NotifyNetworkStateHandler, network.path()), 108 base::Bind(&NotifyNetworkStateHandler, network.path()),
109 base::Bind(&network_handler::ShillErrorCallbackFunction, 109 base::Bind(&network_handler::ShillErrorCallbackFunction,
110 "SetProxyConfig.ClearProperty Failed", 110 "SetProxyConfig.ClearProperty Failed",
111 network.path(), 111 network.path(),
112 network_handler::ErrorCallback())); 112 network_handler::ErrorCallback()));
113 } else { 113 } else {
114 std::string proxy_config_str; 114 std::string proxy_config_str;
115 base::JSONWriter::Write(&proxy_config.GetDictionary(), &proxy_config_str); 115 base::JSONWriter::Write(proxy_config.GetDictionary(), &proxy_config_str);
116 shill_service_client->SetProperty( 116 shill_service_client->SetProperty(
117 dbus::ObjectPath(network.path()), 117 dbus::ObjectPath(network.path()),
118 shill::kProxyConfigProperty, 118 shill::kProxyConfigProperty,
119 base::StringValue(proxy_config_str), 119 base::StringValue(proxy_config_str),
120 base::Bind(&NotifyNetworkStateHandler, network.path()), 120 base::Bind(&NotifyNetworkStateHandler, network.path()),
121 base::Bind(&network_handler::ShillErrorCallbackFunction, 121 base::Bind(&network_handler::ShillErrorCallbackFunction,
122 "SetProxyConfig.SetProperty Failed", 122 "SetProxyConfig.SetProperty Failed",
123 network.path(), 123 network.path(),
124 network_handler::ErrorCallback())); 124 network_handler::ErrorCallback()));
125 } 125 }
126 } 126 }
127 127
128 void RegisterPrefs(PrefRegistrySimple* registry) { 128 void RegisterPrefs(PrefRegistrySimple* registry) {
129 registry->RegisterListPref(prefs::kDeviceOpenNetworkConfiguration); 129 registry->RegisterListPref(prefs::kDeviceOpenNetworkConfiguration);
130 } 130 }
131 131
132 void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) { 132 void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) {
133 registry->RegisterBooleanPref(prefs::kUseSharedProxies, false); 133 registry->RegisterBooleanPref(prefs::kUseSharedProxies, false);
134 134
135 registry->RegisterListPref(prefs::kOpenNetworkConfiguration); 135 registry->RegisterListPref(prefs::kOpenNetworkConfiguration);
136 } 136 }
137 137
138 } // namespace proxy_config 138 } // namespace proxy_config
139 139
140 } // namespace chromeos 140 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698