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

Side by Side Diff: ash/system/chromeos/network/network_observer.cc

Issue 21030006: NetworkState cleanup, pass properties to InitialPropertiesReceived (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 4 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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "ash/system/chromeos/network/network_observer.h" 5 #include "ash/system/chromeos/network/network_observer.h"
6 6
7 #include "chromeos/network/network_state.h" 7 #include "chromeos/network/network_state.h"
8 #include "third_party/cros_system_api/dbus/service_constants.h" 8 #include "third_party/cros_system_api/dbus/service_constants.h"
9 9
10 namespace ash { 10 namespace ash {
11 11
12 //static 12 //static
13 NetworkObserver::NetworkType NetworkObserver::GetNetworkTypeForNetworkState( 13 NetworkObserver::NetworkType NetworkObserver::GetNetworkTypeForNetworkState(
14 const chromeos::NetworkState* network) { 14 const chromeos::NetworkState* network) {
15 if (!network) 15 if (!network)
16 return NETWORK_UNKNOWN; 16 return NETWORK_UNKNOWN;
17 const std::string& type = network->type(); 17 const std::string& type = network->type();
18 if (type == flimflam::kTypeCellular) { 18 if (type == flimflam::kTypeCellular) {
19 if (network->technology() == flimflam::kNetworkTechnologyLte || 19 const std::string& technology = network->network_technology();
20 network->technology() == flimflam::kNetworkTechnologyLteAdvanced) 20 if (technology == flimflam::kNetworkTechnologyLte ||
21 technology == flimflam::kNetworkTechnologyLteAdvanced)
21 return NETWORK_CELLULAR_LTE; 22 return NETWORK_CELLULAR_LTE;
22 else 23 else
23 return NETWORK_CELLULAR; 24 return NETWORK_CELLULAR;
24 } 25 }
25 if (type == flimflam::kTypeEthernet) 26 if (type == flimflam::kTypeEthernet)
26 return NETWORK_ETHERNET; 27 return NETWORK_ETHERNET;
27 if (type == flimflam::kTypeWifi) 28 if (type == flimflam::kTypeWifi)
28 return NETWORK_WIFI; 29 return NETWORK_WIFI;
29 if (type == flimflam::kTypeBluetooth) 30 if (type == flimflam::kTypeBluetooth)
30 return NETWORK_BLUETOOTH; 31 return NETWORK_BLUETOOTH;
31 return NETWORK_UNKNOWN; 32 return NETWORK_UNKNOWN;
32 } 33 }
33 34
34 } // namespace ash 35 } // namespace ash
OLDNEW
« no previous file with comments | « ash/system/chromeos/network/network_icon.cc ('k') | chrome/browser/ui/webui/chromeos/about_network.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698