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

Side by Side Diff: chrome/browser/ui/webui/chromeos/network_ui.cc

Issue 2845113002: Remove raw base::DictionaryValue::SetWithoutPathExpansion in //chrome (Closed)
Patch Set: Address comments 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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/ui/webui/chromeos/network_ui.h" 5 #include "chrome/browser/ui/webui/chromeos/network_ui.h"
6 6
7 #include <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 device_state->properties().DeepCopy()); 57 device_state->properties().DeepCopy());
58 58
59 if (!device_state->ip_configs().empty()) { 59 if (!device_state->ip_configs().empty()) {
60 // Convert IPConfig dictionary to a ListValue. 60 // Convert IPConfig dictionary to a ListValue.
61 std::unique_ptr<base::ListValue> ip_configs(new base::ListValue); 61 std::unique_ptr<base::ListValue> ip_configs(new base::ListValue);
62 for (base::DictionaryValue::Iterator iter(device_state->ip_configs()); 62 for (base::DictionaryValue::Iterator iter(device_state->ip_configs());
63 !iter.IsAtEnd(); iter.Advance()) { 63 !iter.IsAtEnd(); iter.Advance()) {
64 ip_configs->Append(iter.value().CreateDeepCopy()); 64 ip_configs->Append(iter.value().CreateDeepCopy());
65 } 65 }
66 device_dictionary->SetWithoutPathExpansion(shill::kIPConfigsProperty, 66 device_dictionary->SetWithoutPathExpansion(shill::kIPConfigsProperty,
67 ip_configs.release()); 67 std::move(ip_configs));
68 } 68 }
69 if (!device_dictionary->empty()) 69 if (!device_dictionary->empty())
70 dictionary->Set(shill::kDeviceProperty, std::move(device_dictionary)); 70 dictionary->Set(shill::kDeviceProperty, std::move(device_dictionary));
71 } 71 }
72 72
73 class NetworkConfigMessageHandler : public content::WebUIMessageHandler { 73 class NetworkConfigMessageHandler : public content::WebUIMessageHandler {
74 public: 74 public:
75 NetworkConfigMessageHandler() : weak_ptr_factory_(this) {} 75 NetworkConfigMessageHandler() : weak_ptr_factory_(this) {}
76 ~NetworkConfigMessageHandler() override {} 76 ~NetworkConfigMessageHandler() override {}
77 77
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 html->SetDefaultResource(IDR_NETWORK_UI_HTML); 222 html->SetDefaultResource(IDR_NETWORK_UI_HTML);
223 223
224 content::WebUIDataSource::Add(web_ui->GetWebContents()->GetBrowserContext(), 224 content::WebUIDataSource::Add(web_ui->GetWebContents()->GetBrowserContext(),
225 html); 225 html);
226 } 226 }
227 227
228 NetworkUI::~NetworkUI() { 228 NetworkUI::~NetworkUI() {
229 } 229 }
230 230
231 } // namespace chromeos 231 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698