Chromium Code Reviews| Index: chromeos/dbus/shill_service_client_stub.cc |
| diff --git a/chromeos/dbus/shill_service_client_stub.cc b/chromeos/dbus/shill_service_client_stub.cc |
| index 197e19bf0c474b15bbe80c989cb1fc1eb39367c6..d55dfb62ce0f04ab8110deb0a2ddac60667b5897 100644 |
| --- a/chromeos/dbus/shill_service_client_stub.cc |
| +++ b/chromeos/dbus/shill_service_client_stub.cc |
| @@ -41,6 +41,9 @@ void PassStubServiceProperties( |
| } // namespace |
| +const char ShillServiceClientStub::kStubPortalledWifiPath[] = "portalled_wifi"; |
| +const char ShillServiceClientStub::kStubPortalledWifiName[] = "Portalled Wifi"; |
|
oshima
2013/08/06 21:00:02
If you follow my suggestion, you can put them in a
ygorshenin1
2013/08/07 09:00:30
Done.
|
| + |
| ShillServiceClientStub::ShillServiceClientStub() : weak_ptr_factory_(this) { |
| SetDefaultProperties(); |
| } |
| @@ -182,14 +185,16 @@ void ShillServiceClientStub::Connect(const dbus::ObjectPath& service_path, |
| delay = base::TimeDelta::FromSeconds(kConnectDelaySeconds); |
| } |
| // Set Online after a delay |
| - base::StringValue online_value(flimflam::kStateOnline); |
| + std::string state = flimflam::kStateOnline; |
| + if (service_path.value() == kStubPortalledWifiPath) |
| + state = flimflam::kStatePortal; |
|
oshima
2013/08/06 21:00:02
base::StringValue oneline_value(
service_path.v
ygorshenin1
2013/08/07 09:00:30
Done.
|
| base::MessageLoop::current()->PostDelayedTask( |
| FROM_HERE, |
| base::Bind(&ShillServiceClientStub::SetProperty, |
| weak_ptr_factory_.GetWeakPtr(), |
| service_path, |
| flimflam::kStateProperty, |
| - online_value, |
| + base::StringValue(state), |
| base::Bind(&base::DoNothing), |
| error_callback), |
| delay); |
| @@ -293,7 +298,12 @@ void ShillServiceClientStub::AddService(const std::string& service_path, |
| const std::string& state, |
| bool add_to_visible_list, |
| bool add_to_watch_list) { |
| - AddServiceWithIPConfig(service_path, name, type, state, "", |
| + std::string nstate = state; |
| + if (CommandLine::ForCurrentProcess()-> |
| + HasSwitch(chromeos::switches::kDefaultStubNetworkStateIdle)) { |
| + nstate = flimflam::kStateIdle; |
| + } |
| + AddServiceWithIPConfig(service_path, name, type, nstate, "", |
| add_to_visible_list, add_to_watch_list); |
| } |
| @@ -413,6 +423,17 @@ void ShillServiceClientStub::SetDefaultProperties() { |
| flimflam::kSignalStrengthProperty, |
| strength_value); |
| + if (CommandLine::ForCurrentProcess()-> |
| + HasSwitch(chromeos::switches::kEnableStubPortalledWifi)) { |
| + AddService(kStubPortalledWifiPath, kStubPortalledWifiName, |
| + flimflam::kTypeWifi, |
| + flimflam::kStatePortal, |
| + add_to_visible, add_to_watchlist); |
| + SetServiceProperty(kStubPortalledWifiPath, |
| + flimflam::kSecurityProperty, |
| + base::StringValue(flimflam::kSecurityNone)); |
| + } |
| + |
| // Wimax |
| AddService("wimax1", "wimax1", |