Index: chromeos/dbus/fake_shill_service_client.cc |
diff --git a/chromeos/dbus/fake_shill_service_client.cc b/chromeos/dbus/fake_shill_service_client.cc |
index c968d80ec67892806d2c9a00518968a479fc2d2c..376855b74f6848b48d3268b5801a6587b7c4602c 100644 |
--- a/chromeos/dbus/fake_shill_service_client.cc |
+++ b/chromeos/dbus/fake_shill_service_client.cc |
@@ -6,12 +6,10 @@ |
#include "base/bind.h" |
#include "base/bind_helpers.h" |
-#include "base/command_line.h" |
#include "base/message_loop/message_loop.h" |
#include "base/stl_util.h" |
#include "base/strings/string_util.h" |
#include "base/values.h" |
-#include "chromeos/chromeos_switches.h" |
#include "chromeos/dbus/dbus_thread_manager.h" |
#include "chromeos/dbus/shill_manager_client.h" |
#include "chromeos/dbus/shill_property_changed_observer.h" |
@@ -187,18 +185,13 @@ void FakeShillServiceClient::Connect(const dbus::ObjectPath& service_path, |
associating_value); |
// Stay Associating until the state is changed again after a delay. |
- base::TimeDelta delay; |
- if (CommandLine::ForCurrentProcess()->HasSwitch( |
- chromeos::switches::kEnableStubInteractive)) { |
- const int kConnectDelaySeconds = 5; |
- delay = base::TimeDelta::FromSeconds(kConnectDelaySeconds); |
- } |
+ int interactive_delay = DBusThreadManager::Get()->GetShillInteractiveDelay(); |
base::MessageLoop::current()->PostDelayedTask( |
FROM_HERE, |
base::Bind(&FakeShillServiceClient::ContinueConnect, |
weak_ptr_factory_.GetWeakPtr(), |
service_path.value()), |
- delay); |
+ base::TimeDelta::FromSeconds(interactive_delay)); |
callback.Run(); |
} |
@@ -211,13 +204,8 @@ void FakeShillServiceClient::Disconnect(const dbus::ObjectPath& service_path, |
error_callback.Run("Error.InvalidService", "Invalid Service"); |
return; |
} |
- base::TimeDelta delay; |
- if (CommandLine::ForCurrentProcess()->HasSwitch( |
- chromeos::switches::kEnableStubInteractive)) { |
- const int kConnectDelaySeconds = 2; |
- delay = base::TimeDelta::FromSeconds(kConnectDelaySeconds); |
- } |
// Set Idle after a delay |
+ int interactive_delay = DBusThreadManager::Get()->GetShillInteractiveDelay(); |
base::StringValue idle_value(shill::kStateIdle); |
base::MessageLoop::current()->PostDelayedTask( |
FROM_HERE, |
@@ -228,7 +216,7 @@ void FakeShillServiceClient::Disconnect(const dbus::ObjectPath& service_path, |
idle_value, |
base::Bind(&base::DoNothing), |
error_callback), |
- delay); |
+ base::TimeDelta::FromSeconds(interactive_delay)); |
callback.Run(); |
} |
@@ -252,20 +240,15 @@ void FakeShillServiceClient::ActivateCellularModem( |
SetServiceProperty(service_path.value(), |
shill::kActivationStateProperty, |
base::StringValue(shill::kActivationStateActivating)); |
- base::TimeDelta delay; |
- if (CommandLine::ForCurrentProcess()->HasSwitch( |
- chromeos::switches::kEnableStubInteractive)) { |
- const int kConnectDelaySeconds = 2; |
- delay = base::TimeDelta::FromSeconds(kConnectDelaySeconds); |
- } |
// Set Activated after a delay |
+ int interactive_delay = DBusThreadManager::Get()->GetShillInteractiveDelay(); |
base::MessageLoop::current()->PostDelayedTask( |
FROM_HERE, |
base::Bind(&FakeShillServiceClient::SetCellularActivated, |
weak_ptr_factory_.GetWeakPtr(), |
service_path, |
error_callback), |
- delay); |
+ base::TimeDelta::FromSeconds(interactive_delay)); |
base::MessageLoop::current()->PostTask(FROM_HERE, callback); |
} |
@@ -318,12 +301,7 @@ void FakeShillServiceClient::AddService(const std::string& service_path, |
const std::string& state, |
bool add_to_visible_list, |
bool add_to_watch_list) { |
- std::string nstate = state; |
- if (CommandLine::ForCurrentProcess()->HasSwitch( |
- chromeos::switches::kDefaultStubNetworkStateIdle)) { |
- nstate = shill::kStateIdle; |
- } |
- AddServiceWithIPConfig(service_path, name, type, nstate, "", |
+ AddServiceWithIPConfig(service_path, name, type, state, "", |
add_to_visible_list, add_to_watch_list); |
} |