summaryrefslogtreecommitdiffstats
path: root/chromeos
diff options
context:
space:
mode:
authorbenchan@chromium.org <benchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-26 00:23:17 +0000
committerbenchan@chromium.org <benchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-26 00:23:17 +0000
commit644cc3ff0e521e5d79b302363e43b167e3075528 (patch)
treef6d66808a6afe1455322846a7ef5248e48275753 /chromeos
parent5fc1f08925c3b951ee2bb7e6c47abecc8b7ee745 (diff)
downloadchromium_src-644cc3ff0e521e5d79b302363e43b167e3075528.zip
chromium_src-644cc3ff0e521e5d79b302363e43b167e3075528.tar.gz
chromium_src-644cc3ff0e521e5d79b302363e43b167e3075528.tar.bz2
CrOS: Populate WiMAX status to chrome://system via debugd.
This CL adds a binding in DebugDaemonClient to invoke debugd's GetWiMaxStatus DBus method and modifies DebugDaemonLogSource to gather WiMAX information via GetWiMaxStatus. BUG=chrome-os-partner:21256 TEST=Verify that chrome://system shows correct information under 'wimax-status' on Chromebook with / without a WiMAX module. R=oshima@chromium.org, rkc@chromium.org, stevenjb@google.com Review URL: https://codereview.chromium.org/19664011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@213726 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chromeos')
-rw-r--r--chromeos/dbus/debug_daemon_client.cc26
-rw-r--r--chromeos/dbus/debug_daemon_client.h7
2 files changed, 33 insertions, 0 deletions
diff --git a/chromeos/dbus/debug_daemon_client.cc b/chromeos/dbus/debug_daemon_client.cc
index e14abf8..50d5d4b 100644
--- a/chromeos/dbus/debug_daemon_client.cc
+++ b/chromeos/dbus/debug_daemon_client.cc
@@ -230,6 +230,18 @@ class DebugDaemonClientImpl : public DebugDaemonClient {
callback));
}
+ virtual void GetWiMaxStatus(const GetWiMaxStatusCallback& callback)
+ OVERRIDE {
+ dbus::MethodCall method_call(debugd::kDebugdInterface,
+ debugd::kGetWiMaxStatus);
+ debugdaemon_proxy_->CallMethod(
+ &method_call,
+ dbus::ObjectProxy::TIMEOUT_USE_DEFAULT,
+ base::Bind(&DebugDaemonClientImpl::OnGetWiMaxStatus,
+ weak_ptr_factory_.GetWeakPtr(),
+ callback));
+ }
+
virtual void GetNetworkInterfaces(
const GetNetworkInterfacesCallback& callback) OVERRIDE {
dbus::MethodCall method_call(debugd::kDebugdInterface,
@@ -459,6 +471,15 @@ class DebugDaemonClientImpl : public DebugDaemonClient {
callback.Run(false, "");
}
+ void OnGetWiMaxStatus(const GetWiMaxStatusCallback& callback,
+ dbus::Response* response) {
+ std::string status;
+ if (response && dbus::MessageReader(response).PopString(&status))
+ callback.Run(true, status);
+ else
+ callback.Run(false, "");
+ }
+
void OnGetNetworkInterfaces(const GetNetworkInterfacesCallback& callback,
dbus::Response* response) {
std::string status;
@@ -618,6 +639,11 @@ class DebugDaemonClientStubImpl : public DebugDaemonClient {
base::MessageLoop::current()->PostTask(FROM_HERE,
base::Bind(callback, false, ""));
}
+ virtual void GetWiMaxStatus(const GetWiMaxStatusCallback& callback)
+ OVERRIDE {
+ base::MessageLoop::current()->PostTask(FROM_HERE,
+ base::Bind(callback, false, ""));
+ }
virtual void GetNetworkInterfaces(
const GetNetworkInterfacesCallback& callback) OVERRIDE {
base::MessageLoop::current()->PostTask(FROM_HERE,
diff --git a/chromeos/dbus/debug_daemon_client.h b/chromeos/dbus/debug_daemon_client.h
index af332d5..92652e3 100644
--- a/chromeos/dbus/debug_daemon_client.h
+++ b/chromeos/dbus/debug_daemon_client.h
@@ -68,6 +68,13 @@ class CHROMEOS_EXPORT DebugDaemonClient {
// Gets information about modem status as json.
virtual void GetModemStatus(const GetModemStatusCallback& callback) = 0;
+ // Called once GetWiMaxStatus() is complete.
+ typedef base::Callback<void(bool succeeded, const std::string& status)>
+ GetWiMaxStatusCallback;
+
+ // Gets information about WiMAX status as json.
+ virtual void GetWiMaxStatus(const GetWiMaxStatusCallback& callback) = 0;
+
// Called once GetNetworkInterfaces() is complete. Takes two parameters:
// - succeeded: information was obtained successfully.
// - status: network interfaces information in json. For details, please refer