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

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

Issue 23075012: Update NetworkStateNotifier to use message_center. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Track deafult_network and reset did_show_out_of_credits on any change 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "ash/system/chromeos/network/network_observer.h"
6
7 #include "chromeos/network/network_state.h"
8 #include "third_party/cros_system_api/dbus/service_constants.h"
9
10 namespace ash {
11
12 //static
13 NetworkObserver::NetworkType NetworkObserver::GetNetworkTypeForNetworkState(
14 const chromeos::NetworkState* network) {
15 if (!network)
16 return NETWORK_UNKNOWN;
17 const std::string& type = network->type();
18 if (type == flimflam::kTypeCellular) {
19 const std::string& technology = network->network_technology();
20 if (technology == flimflam::kNetworkTechnologyLte ||
21 technology == flimflam::kNetworkTechnologyLteAdvanced)
22 return NETWORK_CELLULAR_LTE;
23 else
24 return NETWORK_CELLULAR;
25 }
26 if (type == flimflam::kTypeEthernet)
27 return NETWORK_ETHERNET;
28 if (type == flimflam::kTypeWifi)
29 return NETWORK_WIFI;
30 if (type == flimflam::kTypeBluetooth)
31 return NETWORK_BLUETOOTH;
32 return NETWORK_UNKNOWN;
33 }
34
35 } // namespace ash
OLDNEW
« no previous file with comments | « ash/system/chromeos/network/network_observer.h ('k') | ash/system/chromeos/network/network_state_notifier.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698