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

Unified Diff: ash/system/chromeos/network/network_connect.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_connect.h ('k') | ash/system/chromeos/network/network_icon.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/chromeos/network/network_connect.cc
diff --git a/ash/system/chromeos/network/network_connect.cc b/ash/system/chromeos/network/network_connect.cc
index 709b9728de283de74b03e1e665bff8c8da7b264a..0f9000214cf3e243f15831617d9a231c3c003903 100644
--- a/ash/system/chromeos/network/network_connect.cc
+++ b/ash/system/chromeos/network/network_connect.cc
@@ -24,6 +24,7 @@
#include "chromeos/network/network_profile_handler.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"
@@ -40,6 +41,7 @@ using chromeos::NetworkProfile;
using chromeos::NetworkProfileHandler;
using chromeos::NetworkState;
using chromeos::NetworkStateHandler;
+using chromeos::NetworkTypePattern;
namespace ash {
@@ -281,10 +283,11 @@ void ConnectToNetwork(const std::string& service_path,
CallConnectToNetwork(service_path, check_error_state, owning_window);
}
-void SetTechnologyEnabled(const std::string& technology, bool enabled_state) {
+void SetTechnologyEnabled(const NetworkTypePattern& technology,
+ bool enabled_state) {
std::string log_string =
base::StringPrintf("technology %s, target state: %s",
- technology.c_str(),
+ technology.ToDebugString().c_str(),
(enabled_state ? "ENABLED" : "DISABLED"));
NET_LOG_USER("SetTechnologyEnabled", log_string);
NetworkStateHandler* handler = NetworkHandler::Get()->network_state_handler();
@@ -302,8 +305,7 @@ void SetTechnologyEnabled(const std::string& technology, bool enabled_state) {
// If we're dealing with a mobile network, then handle SIM lock here.
// SIM locking only applies to cellular, so the code below won't execute
// if |technology| has been explicitly set to WiMAX.
- if (technology == NetworkStateHandler::kMatchTypeMobile ||
- technology == flimflam::kTypeCellular) {
+ if (technology.MatchesPattern(NetworkTypePattern::Mobile())) {
const DeviceState* mobile = handler->GetDeviceStateByType(technology);
if (!mobile) {
NET_LOG_ERROR("SetTechnologyEnabled with no device", log_string);
« no previous file with comments | « ash/system/chromeos/network/network_connect.h ('k') | ash/system/chromeos/network/network_icon.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698