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

Side by Side Diff: components/wifi/wifi_service.cc

Issue 64683014: Mac OS X-specific implementation of Networking Private API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address codereview comments. Created 6 years, 11 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 | Annotate | Revision Log
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 "components/wifi/wifi_service.h" 5 #include "components/wifi/wifi_service.h"
6 6
7 #include "base/json/json_reader.h" 7 #include "base/json/json_reader.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "components/onc/onc_constants.h" 10 #include "components/onc/onc_constants.h"
(...skipping 21 matching lines...) Expand all
32 if (type == onc::network_type::kWiFi) { 32 if (type == onc::network_type::kWiFi) {
33 scoped_ptr<base::DictionaryValue> wifi(new base::DictionaryValue()); 33 scoped_ptr<base::DictionaryValue> wifi(new base::DictionaryValue());
34 wifi->SetString(onc::wifi::kSecurity, security); 34 wifi->SetString(onc::wifi::kSecurity, security);
35 wifi->SetInteger(onc::wifi::kSignalStrength, signal_strength); 35 wifi->SetInteger(onc::wifi::kSignalStrength, signal_strength);
36 36
37 // Network list expects subset of data. 37 // Network list expects subset of data.
38 if (!network_list) { 38 if (!network_list) {
39 if (frequency != WiFiService::kFrequencyUnknown) 39 if (frequency != WiFiService::kFrequencyUnknown)
40 wifi->SetInteger(onc::wifi::kFrequency, frequency); 40 wifi->SetInteger(onc::wifi::kFrequency, frequency);
41 scoped_ptr<base::ListValue> frequency_list(new base::ListValue()); 41 scoped_ptr<base::ListValue> frequency_list(new base::ListValue());
42 for (FrequencyList::const_iterator it = this->frequency_list.begin(); 42 for (FrequencySet::const_iterator it = this->frequency_set.begin();
43 it != this->frequency_list.end(); 43 it != this->frequency_set.end();
44 ++it) { 44 ++it) {
45 frequency_list->AppendInteger(*it); 45 frequency_list->AppendInteger(*it);
46 } 46 }
47 if (!frequency_list->empty()) 47 if (!frequency_list->empty())
48 wifi->Set(onc::wifi::kFrequencyList, frequency_list.release()); 48 wifi->Set(onc::wifi::kFrequencyList, frequency_list.release());
49 if (!bssid.empty()) 49 if (!bssid.empty())
50 wifi->SetString(onc::wifi::kBSSID, bssid); 50 wifi->SetString(onc::wifi::kBSSID, bssid);
51 wifi->SetString(onc::wifi::kSSID, ssid); 51 wifi->SetString(onc::wifi::kSSID, ssid);
52 } 52 }
53 value->Set(onc::network_type::kWiFi, wifi.release()); 53 value->Set(onc::network_type::kWiFi, wifi.release());
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 if (l.type == r.type) 104 if (l.type == r.type)
105 return l.guid < r.guid; 105 return l.guid < r.guid;
106 if (l.type == onc::network_type::kEthernet) 106 if (l.type == onc::network_type::kEthernet)
107 return true; 107 return true;
108 if (r.type == onc::network_type::kEthernet) 108 if (r.type == onc::network_type::kEthernet)
109 return false; 109 return false;
110 return l.type > r.type; 110 return l.type > r.type;
111 } 111 }
112 112
113 } // namespace wifi 113 } // namespace wifi
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698