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

Side by Side Diff: chromeos/network/network_util.cc

Issue 2871653002: Remove raw base::DictionaryValue::SetWithoutPathExpansion in //chromeos (Closed)
Patch Set: Minor Fix Created 3 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
« no previous file with comments | « chromeos/network/network_ui_data.cc ('k') | chromeos/network/onc/onc_mapper.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chromeos/network/network_util.h" 5 #include "chromeos/network/network_util.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <utility> 10 #include <utility>
11 11
12 #include "base/strings/string_number_conversions.h" 12 #include "base/strings/string_number_conversions.h"
13 #include "base/strings/string_tokenizer.h" 13 #include "base/strings/string_tokenizer.h"
14 #include "base/strings/string_util.h" 14 #include "base/strings/string_util.h"
15 #include "base/values.h"
15 #include "chromeos/login/login_state.h" 16 #include "chromeos/login/login_state.h"
16 #include "chromeos/network/device_state.h" 17 #include "chromeos/network/device_state.h"
17 #include "chromeos/network/managed_network_configuration_handler.h" 18 #include "chromeos/network/managed_network_configuration_handler.h"
18 #include "chromeos/network/network_state.h" 19 #include "chromeos/network/network_state.h"
19 #include "chromeos/network/network_state_handler.h" 20 #include "chromeos/network/network_state_handler.h"
20 #include "chromeos/network/network_ui_data.h" 21 #include "chromeos/network/network_ui_data.h"
21 #include "chromeos/network/onc/onc_signature.h" 22 #include "chromeos/network/onc/onc_signature.h"
22 #include "chromeos/network/onc/onc_translation_tables.h" 23 #include "chromeos/network/onc/onc_translation_tables.h"
23 #include "chromeos/network/onc/onc_translator.h" 24 #include "chromeos/network/onc/onc_translator.h"
24 #include "third_party/cros_system_api/dbus/service_constants.h" 25 #include "third_party/cros_system_api/dbus/service_constants.h"
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 const DeviceState* device = 173 const DeviceState* device =
173 NetworkHandler::Get()->network_state_handler()->GetDeviceState( 174 NetworkHandler::Get()->network_state_handler()->GetDeviceState(
174 network->device_path()); 175 network->device_path());
175 if (device) { 176 if (device) {
176 std::unique_ptr<base::DictionaryValue> device_dict( 177 std::unique_ptr<base::DictionaryValue> device_dict(
177 new base::DictionaryValue); 178 new base::DictionaryValue);
178 device_dict->SetBooleanWithoutPathExpansion( 179 device_dict->SetBooleanWithoutPathExpansion(
179 shill::kProviderRequiresRoamingProperty, 180 shill::kProviderRequiresRoamingProperty,
180 device->provider_requires_roaming()); 181 device->provider_requires_roaming());
181 shill_dictionary->SetWithoutPathExpansion(shill::kDeviceProperty, 182 shill_dictionary->SetWithoutPathExpansion(shill::kDeviceProperty,
182 device_dict.release()); 183 std::move(device_dict));
183 } 184 }
184 } 185 }
185 186
186 // NetworkState is always associated with the primary user profile, regardless 187 // NetworkState is always associated with the primary user profile, regardless
187 // of what profile is associated with the page that calls this method. We do 188 // of what profile is associated with the page that calls this method. We do
188 // not expose any sensitive properties in the resulting dictionary, it is 189 // not expose any sensitive properties in the resulting dictionary, it is
189 // only used to show connection state and icons. 190 // only used to show connection state and icons.
190 std::string user_id_hash = chromeos::LoginState::Get()->primary_user_hash(); 191 std::string user_id_hash = chromeos::LoginState::Get()->primary_user_hash();
191 ::onc::ONCSource onc_source = ::onc::ONC_SOURCE_NONE; 192 ::onc::ONCSource onc_source = ::onc::ONC_SOURCE_NONE;
192 NetworkHandler::Get() 193 NetworkHandler::Get()
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 std::string TranslateShillTypeToONC(const std::string& shill_type) { 229 std::string TranslateShillTypeToONC(const std::string& shill_type) {
229 if (shill_type == shill::kTypeEthernet) 230 if (shill_type == shill::kTypeEthernet)
230 return ::onc::network_type::kEthernet; 231 return ::onc::network_type::kEthernet;
231 std::string onc_type; 232 std::string onc_type;
232 onc::TranslateStringToONC(onc::kNetworkTypeTable, shill_type, &onc_type); 233 onc::TranslateStringToONC(onc::kNetworkTypeTable, shill_type, &onc_type);
233 return onc_type; 234 return onc_type;
234 } 235 }
235 236
236 } // namespace network_util 237 } // namespace network_util
237 } // namespace chromeos 238 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/network/network_ui_data.cc ('k') | chromeos/network/onc/onc_mapper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698