| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chromeos/dbus/shill_manager_client.h" | 5 #include "chromeos/dbus/shill_manager_client.h" |
| 6 | 6 |
| 7 #include <memory> |
| 8 |
| 7 #include "base/bind.h" | 9 #include "base/bind.h" |
| 8 #include "base/logging.h" | 10 #include "base/logging.h" |
| 9 #include "base/macros.h" | 11 #include "base/macros.h" |
| 10 #include "base/message_loop/message_loop.h" | 12 #include "base/message_loop/message_loop.h" |
| 11 #include "base/values.h" | 13 #include "base/values.h" |
| 12 #include "chromeos/dbus/shill_property_changed_observer.h" | 14 #include "chromeos/dbus/shill_property_changed_observer.h" |
| 13 #include "dbus/bus.h" | 15 #include "dbus/bus.h" |
| 14 #include "dbus/message.h" | 16 #include "dbus/message.h" |
| 15 #include "dbus/object_path.h" | 17 #include "dbus/object_path.h" |
| 16 #include "dbus/object_proxy.h" | 18 #include "dbus/object_proxy.h" |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 const ErrorCallback& error_callback) override { | 85 const ErrorCallback& error_callback) override { |
| 84 dbus::MethodCall method_call(shill::kFlimflamManagerInterface, | 86 dbus::MethodCall method_call(shill::kFlimflamManagerInterface, |
| 85 shill::kEnableTechnologyFunction); | 87 shill::kEnableTechnologyFunction); |
| 86 dbus::MessageWriter writer(&method_call); | 88 dbus::MessageWriter writer(&method_call); |
| 87 writer.AppendString(type); | 89 writer.AppendString(type); |
| 88 helper_->CallVoidMethodWithErrorCallback(&method_call, | 90 helper_->CallVoidMethodWithErrorCallback(&method_call, |
| 89 callback, | 91 callback, |
| 90 error_callback); | 92 error_callback); |
| 91 } | 93 } |
| 92 | 94 |
| 95 void SetNetworkThrottlingStatus( |
| 96 const bool enabled, |
| 97 const uint32_t upload_rate_kbits, |
| 98 const uint32_t download_rate_kbits, |
| 99 const base::Closure& callback, |
| 100 const ErrorCallback& error_callback) override { |
| 101 dbus::MethodCall method_call(shill::kFlimflamManagerInterface, |
| 102 shill::kSetNetworkThrottlingFunction); |
| 103 dbus::MessageWriter writer(&method_call); |
| 104 writer.AppendBool(enabled); |
| 105 writer.AppendUint32(upload_rate_kbits); |
| 106 writer.AppendUint32(download_rate_kbits); |
| 107 helper_->CallVoidMethodWithErrorCallback(&method_call, callback, |
| 108 error_callback); |
| 109 } |
| 110 |
| 93 void DisableTechnology(const std::string& type, | 111 void DisableTechnology(const std::string& type, |
| 94 const base::Closure& callback, | 112 const base::Closure& callback, |
| 95 const ErrorCallback& error_callback) override { | 113 const ErrorCallback& error_callback) override { |
| 96 dbus::MethodCall method_call(shill::kFlimflamManagerInterface, | 114 dbus::MethodCall method_call(shill::kFlimflamManagerInterface, |
| 97 shill::kDisableTechnologyFunction); | 115 shill::kDisableTechnologyFunction); |
| 98 dbus::MessageWriter writer(&method_call); | 116 dbus::MessageWriter writer(&method_call); |
| 99 writer.AppendString(type); | 117 writer.AppendString(type); |
| 100 helper_->CallVoidMethodWithErrorCallback(&method_call, | 118 helper_->CallVoidMethodWithErrorCallback(&method_call, |
| 101 callback, | 119 callback, |
| 102 error_callback); | 120 error_callback); |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 } | 253 } |
| 236 | 254 |
| 237 // ShillManagerClient::VerificationProperties implementation. | 255 // ShillManagerClient::VerificationProperties implementation. |
| 238 ShillManagerClient::VerificationProperties::VerificationProperties() { | 256 ShillManagerClient::VerificationProperties::VerificationProperties() { |
| 239 } | 257 } |
| 240 | 258 |
| 241 ShillManagerClient::VerificationProperties::~VerificationProperties() { | 259 ShillManagerClient::VerificationProperties::~VerificationProperties() { |
| 242 } | 260 } |
| 243 | 261 |
| 244 } // namespace chromeos | 262 } // namespace chromeos |
| OLD | NEW |