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

Unified Diff: ash/system/chromeos/network/tray_network.cc

Issue 23712002: Cleanup network type matching. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed unit test in Debug. Created 7 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/system/chromeos/network/network_state_notifier.cc ('k') | ash/system/chromeos/network/tray_vpn.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/chromeos/network/tray_network.cc
diff --git a/ash/system/chromeos/network/tray_network.cc b/ash/system/chromeos/network/tray_network.cc
index e4a5fb1e078a3ba3726dd4495d613374827da574..a083316490e1104f54c591bed3265b2c787a0104 100644
--- a/ash/system/chromeos/network/tray_network.cc
+++ b/ash/system/chromeos/network/tray_network.cc
@@ -20,6 +20,7 @@
#include "base/strings/utf_string_conversions.h"
#include "chromeos/network/network_state.h"
#include "chromeos/network/network_state_handler.h"
+#include "chromeos/network/shill_property_util.h"
#include "grit/ash_resources.h"
#include "grit/ash_strings.h"
#include "third_party/cros_system_api/dbus/service_constants.h"
@@ -35,6 +36,7 @@
using chromeos::NetworkHandler;
using chromeos::NetworkState;
using chromeos::NetworkStateHandler;
+using chromeos::NetworkTypePattern;
namespace ash {
namespace internal {
@@ -79,8 +81,8 @@ class NetworkTrayView : public TrayItemView,
else
network_icon::NetworkIconAnimation::GetInstance()->RemoveObserver(this);
// Update accessibility.
- const NetworkState* connected_network = handler->ConnectedNetworkByType(
- NetworkStateHandler::kMatchTypeNonVirtual);
+ const NetworkState* connected_network =
+ handler->ConnectedNetworkByType(NetworkTypePattern::NonVirtual());
if (connected_network)
UpdateConnectionStatus(UTF8ToUTF16(connected_network->name()), true);
else
@@ -220,8 +222,9 @@ class NetworkWifiDetailedView : public NetworkDetailedView {
}
void Update() {
- bool wifi_enabled = NetworkHandler::Get()->network_state_handler()->
- IsTechnologyEnabled(flimflam::kTypeWifi);
+ bool wifi_enabled =
+ NetworkHandler::Get()->network_state_handler()->IsTechnologyEnabled(
+ NetworkTypePattern::WiFi());
const int image_id = wifi_enabled ?
IDR_AURA_UBER_TRAY_WIFI_ENABLED : IDR_AURA_UBER_TRAY_WIFI_DISABLED;
ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance();
@@ -319,10 +322,10 @@ void TrayNetwork::RequestToggleWifi() {
PopupDetailedView(kTrayPopupAutoCloseDelayForTextInSeconds, false);
}
NetworkStateHandler* handler = NetworkHandler::Get()->network_state_handler();
- bool enabled = handler->IsTechnologyEnabled(flimflam::kTypeWifi);
- handler->SetTechnologyEnabled(
- flimflam::kTypeWifi, !enabled,
- chromeos::network_handler::ErrorCallback());
+ bool enabled = handler->IsTechnologyEnabled(NetworkTypePattern::WiFi());
+ handler->SetTechnologyEnabled(NetworkTypePattern::WiFi(),
+ !enabled,
+ chromeos::network_handler::ErrorCallback());
}
void TrayNetwork::NetworkStateChanged(bool list_changed) {
« no previous file with comments | « ash/system/chromeos/network/network_state_notifier.cc ('k') | ash/system/chromeos/network/tray_vpn.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698