summaryrefslogtreecommitdiffstats
path: root/chromeos
diff options
context:
space:
mode:
authorstevenjb@chromium.org <stevenjb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-02 19:45:15 +0000
committerstevenjb@chromium.org <stevenjb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-02 19:45:15 +0000
commitd572da7cf7a48f87e93f83c9073aa0c8d3bc800b (patch)
tree4959bdee0ef78630709a3380c059ee2e2cd24460 /chromeos
parent1134653e2438fabfac9dedc25c0fd1369fa2d43f (diff)
downloadchromium_src-d572da7cf7a48f87e93f83c9073aa0c8d3bc800b.zip
chromium_src-d572da7cf7a48f87e93f83c9073aa0c8d3bc800b.tar.gz
chromium_src-d572da7cf7a48f87e93f83c9073aa0c8d3bc800b.tar.bz2
Elim non chrome specific network code from ash_system_tray_delegate
This moves all networking related code out of ash_system_tray_delegate except showing the Configure, Enroll, or setup dialogs. BUG=154856 R=gspencer@chromium.org, pneubeck@chromium.org Review URL: https://codereview.chromium.org/24792004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@226533 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chromeos')
-rw-r--r--chromeos/dbus/shill_service_client_stub.cc5
-rw-r--r--chromeos/dbus/shill_stub_helper.cc21
-rw-r--r--chromeos/dbus/shill_stub_helper.h2
3 files changed, 24 insertions, 4 deletions
diff --git a/chromeos/dbus/shill_service_client_stub.cc b/chromeos/dbus/shill_service_client_stub.cc
index 1336f05..8e2be67 100644
--- a/chromeos/dbus/shill_service_client_stub.cc
+++ b/chromeos/dbus/shill_service_client_stub.cc
@@ -15,6 +15,7 @@
#include "chromeos/dbus/dbus_thread_manager.h"
#include "chromeos/dbus/shill_manager_client.h"
#include "chromeos/dbus/shill_property_changed_observer.h"
+#include "chromeos/dbus/shill_stub_helper.h"
#include "dbus/bus.h"
#include "dbus/message.h"
#include "dbus/object_path.h"
@@ -351,6 +352,10 @@ void ShillServiceClientStub::AddServiceWithIPConfig(
shill::kNameProperty,
base::Value::CreateStringValue(name));
properties->SetWithoutPathExpansion(
+ shill::kDeviceProperty,
+ base::Value::CreateStringValue(
+ shill_stub_helper::DevicePathForType(type)));
+ properties->SetWithoutPathExpansion(
shill::kTypeProperty,
base::Value::CreateStringValue(type));
properties->SetWithoutPathExpansion(
diff --git a/chromeos/dbus/shill_stub_helper.cc b/chromeos/dbus/shill_stub_helper.cc
index fcf6dfa..ede2f75 100644
--- a/chromeos/dbus/shill_stub_helper.cc
+++ b/chromeos/dbus/shill_stub_helper.cc
@@ -20,6 +20,10 @@ namespace shill_stub_helper {
namespace {
+const char kDevicePathWifi[] = "/device/wifi1";
+const char kDevicePathCellular[] = "/device/cellular1";
+const char kDevicePathWimax[] = "/device/wimax1";
+
const char kStubPortalledWifiName[] = "Portalled Wifi";
const char kStubPortalledWifiPath[] = "portalled_wifi";
@@ -68,18 +72,17 @@ void SetupDefaultEnvironment() {
profiles->AddProfile(kSharedProfilePath, std::string());
// Add a wifi device.
- devices->AddDevice("stub_wifi_device1", shill::kTypeWifi, "/device/wifi1");
+ devices->AddDevice(kDevicePathWifi, shill::kTypeWifi, "stub_wifi_device1");
// Add a cellular device. Used in SMS stub.
devices->AddDevice(
- "stub_cellular_device1", shill::kTypeCellular, "/device/cellular1");
+ kDevicePathCellular, shill::kTypeCellular, "stub_cellular_device1");
devices->SetDeviceProperty("stub_cellular_device1",
shill::kCarrierProperty,
base::StringValue(shill::kCarrierSprint));
// Add a wimax device.
- devices->AddDevice(
- "stub_wimax_device1", shill::kTypeWimax, "/device/wimax1");
+ devices->AddDevice(kDevicePathWimax, shill::kTypeWimax, "stub_wimax_device1");
const bool add_to_visible = true;
const bool add_to_watchlist = true;
@@ -193,5 +196,15 @@ void SetupDefaultEnvironment() {
manager->SortManagerServices();
}
+std::string DevicePathForType(const std::string& type) {
+ if (type == shill::kTypeWifi)
+ return kDevicePathWifi;
+ if (type == shill::kTypeCellular)
+ return kDevicePathCellular;
+ if (type == shill::kTypeWimax)
+ return kDevicePathWimax;
+ return "";
+}
+
} // namespace shill_stub_helper
} // namespace chromeos
diff --git a/chromeos/dbus/shill_stub_helper.h b/chromeos/dbus/shill_stub_helper.h
index 16c7031..e5b999b 100644
--- a/chromeos/dbus/shill_stub_helper.h
+++ b/chromeos/dbus/shill_stub_helper.h
@@ -18,6 +18,8 @@ CHROMEOS_EXPORT extern const char kSharedProfilePath[];
// DBusThreadManager was initialized with the Shill*ClientStubs.
void SetupDefaultEnvironment();
+std::string DevicePathForType(const std::string& type);
+
// Returns true when stub portalled wifi is enabled and it's service
// path equals to |path|.
CHROMEOS_EXPORT bool IsStubPortalledWifiEnabled(const std::string& path);