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

Side by Side Diff: chrome/browser/chromeos/cros/network_ui_data.cc

Issue 8804020: Set onc_source UI data parameter when importing ONC. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Created 9 years 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/cros/network_ui_data.h" 5 #include "chrome/browser/chromeos/cros/network_ui_data.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "chrome/browser/chromeos/cros/network_library.h" 8 #include "chrome/browser/chromeos/cros/network_library.h"
9 9
10 namespace chromeos { 10 namespace chromeos {
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 61
62 NetworkUIData::~NetworkUIData() { 62 NetworkUIData::~NetworkUIData() {
63 } 63 }
64 64
65 void NetworkUIData::SetProperty(const char* property_key, 65 void NetworkUIData::SetProperty(const char* property_key,
66 const NetworkPropertyUIData& ui_data) { 66 const NetworkPropertyUIData& ui_data) {
67 properties_.Set(property_key, ui_data.BuildDictionary()); 67 properties_.Set(property_key, ui_data.BuildDictionary());
68 } 68 }
69 69
70 void NetworkUIData::FillDictionary(base::DictionaryValue* dict) const { 70 void NetworkUIData::FillDictionary(base::DictionaryValue* dict) const {
71 dict->Clear();
72
71 std::string source_string(GetONCSourceMapper().GetKey(onc_source_)); 73 std::string source_string(GetONCSourceMapper().GetKey(onc_source_));
72 if (!source_string.empty()) 74 if (!source_string.empty())
73 dict->SetString(kKeyONCSource, source_string); 75 dict->SetString(kKeyONCSource, source_string);
74 dict->Set(kKeyProperties, properties_.DeepCopy()); 76 dict->Set(kKeyProperties, properties_.DeepCopy());
75 } 77 }
76 78
77 // static 79 // static
78 NetworkUIData::ONCSource NetworkUIData::GetONCSource(const Network* network) { 80 NetworkUIData::ONCSource NetworkUIData::GetONCSource(const Network* network) {
79 std::string source; 81 std::string source;
80 if (network->ui_data()->GetString(kKeyONCSource, &source)) 82 if (network->ui_data()->GetString(kKeyONCSource, &source))
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 // static 161 // static
160 EnumMapper<NetworkPropertyUIData::Controller>& 162 EnumMapper<NetworkPropertyUIData::Controller>&
161 NetworkPropertyUIData::GetControllerMapper() { 163 NetworkPropertyUIData::GetControllerMapper() {
162 CR_DEFINE_STATIC_LOCAL(EnumMapper<Controller>, mapper, 164 CR_DEFINE_STATIC_LOCAL(EnumMapper<Controller>, mapper,
163 (kControllerTable, arraysize(kControllerTable), 165 (kControllerTable, arraysize(kControllerTable),
164 CONTROLLER_USER)); 166 CONTROLLER_USER));
165 return mapper; 167 return mapper;
166 } 168 }
167 169
168 } // namespace chromeos 170 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/cros/network_ui_data.h ('k') | chrome/browser/chromeos/cros/onc_network_parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698