OLD | NEW |
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/values.h" | 10 #include "base/values.h" |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 | 100 |
101 void NetworkUIData::FillDictionary(base::DictionaryValue* dict) const { | 101 void NetworkUIData::FillDictionary(base::DictionaryValue* dict) const { |
102 dict->Clear(); | 102 dict->Clear(); |
103 | 103 |
104 std::string source_string = GetONCSourceAsString(); | 104 std::string source_string = GetONCSourceAsString(); |
105 if (!source_string.empty()) | 105 if (!source_string.empty()) |
106 dict->SetString(kKeyONCSource, source_string); | 106 dict->SetString(kKeyONCSource, source_string); |
107 | 107 |
108 if (user_settings_) | 108 if (user_settings_) |
109 dict->SetWithoutPathExpansion(kKeyUserSettings, | 109 dict->SetWithoutPathExpansion(kKeyUserSettings, |
110 user_settings_->DeepCopy()); | 110 user_settings_->CreateDeepCopy()); |
111 } | 111 } |
112 | 112 |
113 // static | 113 // static |
114 std::unique_ptr<NetworkUIData> NetworkUIData::CreateFromONC( | 114 std::unique_ptr<NetworkUIData> NetworkUIData::CreateFromONC( |
115 ::onc::ONCSource onc_source) { | 115 ::onc::ONCSource onc_source) { |
116 std::unique_ptr<NetworkUIData> ui_data(new NetworkUIData()); | 116 std::unique_ptr<NetworkUIData> ui_data(new NetworkUIData()); |
117 | 117 |
118 ui_data->onc_source_ = onc_source; | 118 ui_data->onc_source_ = onc_source; |
119 | 119 |
120 return ui_data; | 120 return ui_data; |
121 } | 121 } |
122 | 122 |
123 } // namespace chromeos | 123 } // namespace chromeos |
OLD | NEW |