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

Side by Side Diff: chromeos/network/network_ui_data.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_state_unittest.cc ('k') | chromeos/network/network_util.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_ui_data.h" 5 #include "chromeos/network/network_ui_data.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/ptr_util.h"
10 #include "base/values.h" 11 #include "base/values.h"
11 12
12 namespace chromeos { 13 namespace chromeos {
13 14
14 // Top-level UI data dictionary keys. 15 // Top-level UI data dictionary keys.
15 const char NetworkUIData::kKeyONCSource[] = "onc_source"; 16 const char NetworkUIData::kKeyONCSource[] = "onc_source";
16 const char NetworkUIData::kKeyUserSettings[] = "user_settings"; 17 const char NetworkUIData::kKeyUserSettings[] = "user_settings";
17 const char NetworkUIData::kONCSourceUserImport[] = "user_import"; 18 const char NetworkUIData::kONCSourceUserImport[] = "user_import";
18 const char NetworkUIData::kONCSourceDevicePolicy[] = "device_policy"; 19 const char NetworkUIData::kONCSourceDevicePolicy[] = "device_policy";
19 const char NetworkUIData::kONCSourceUserPolicy[] = "user_policy"; 20 const char NetworkUIData::kONCSourceUserPolicy[] = "user_policy";
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 } 100 }
100 101
101 void NetworkUIData::FillDictionary(base::DictionaryValue* dict) const { 102 void NetworkUIData::FillDictionary(base::DictionaryValue* dict) const {
102 dict->Clear(); 103 dict->Clear();
103 104
104 std::string source_string = GetONCSourceAsString(); 105 std::string source_string = GetONCSourceAsString();
105 if (!source_string.empty()) 106 if (!source_string.empty())
106 dict->SetString(kKeyONCSource, source_string); 107 dict->SetString(kKeyONCSource, source_string);
107 108
108 if (user_settings_) 109 if (user_settings_)
109 dict->SetWithoutPathExpansion(kKeyUserSettings, 110 dict->SetWithoutPathExpansion(
110 user_settings_->DeepCopy()); 111 kKeyUserSettings, base::MakeUnique<base::Value>(*user_settings_));
111 } 112 }
112 113
113 // static 114 // static
114 std::unique_ptr<NetworkUIData> NetworkUIData::CreateFromONC( 115 std::unique_ptr<NetworkUIData> NetworkUIData::CreateFromONC(
115 ::onc::ONCSource onc_source) { 116 ::onc::ONCSource onc_source) {
116 std::unique_ptr<NetworkUIData> ui_data(new NetworkUIData()); 117 std::unique_ptr<NetworkUIData> ui_data(new NetworkUIData());
117 118
118 ui_data->onc_source_ = onc_source; 119 ui_data->onc_source_ = onc_source;
119 120
120 return ui_data; 121 return ui_data;
121 } 122 }
122 123
123 } // namespace chromeos 124 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/network/network_state_unittest.cc ('k') | chromeos/network/network_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698