Chromium Code Reviews| 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/network/network_configuration_handler.h" | 5 #include "chromeos/network/network_configuration_handler.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 14 #include "base/values.h" | 14 #include "base/values.h" |
| 15 #include "chromeos/dbus/dbus_method_call_status.h" | 15 #include "chromeos/dbus/dbus_method_call_status.h" |
| 16 #include "chromeos/dbus/dbus_thread_manager.h" | 16 #include "chromeos/dbus/dbus_thread_manager.h" |
| 17 #include "chromeos/dbus/shill_manager_client.h" | 17 #include "chromeos/dbus/shill_manager_client.h" |
| 18 #include "chromeos/dbus/shill_service_client.h" | 18 #include "chromeos/dbus/shill_service_client.h" |
| 19 #include "chromeos/network/network_state_handler.h" | |
| 19 #include "dbus/object_path.h" | 20 #include "dbus/object_path.h" |
| 20 #include "third_party/cros_system_api/dbus/service_constants.h" | 21 #include "third_party/cros_system_api/dbus/service_constants.h" |
| 21 | 22 |
| 22 namespace chromeos { | 23 namespace chromeos { |
| 23 | 24 |
| 24 namespace { | 25 namespace { |
| 25 | 26 |
| 26 const char kLogModule[] = "NetworkConfigurationHandler"; | 27 const char kLogModule[] = "NetworkConfigurationHandler"; |
| 27 | 28 |
| 28 NetworkConfigurationHandler* g_configuration_handler_instance = NULL; | 29 NetworkConfigurationHandler* g_configuration_handler_instance = NULL; |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 142 void NetworkConfigurationHandler::SetProperties( | 143 void NetworkConfigurationHandler::SetProperties( |
| 143 const std::string& service_path, | 144 const std::string& service_path, |
| 144 const base::DictionaryValue& properties, | 145 const base::DictionaryValue& properties, |
| 145 const base::Closure& callback, | 146 const base::Closure& callback, |
| 146 const network_handler::ErrorCallback& error_callback) const { | 147 const network_handler::ErrorCallback& error_callback) const { |
| 147 DBusThreadManager::Get()->GetShillManagerClient()->ConfigureService( | 148 DBusThreadManager::Get()->GetShillManagerClient()->ConfigureService( |
| 148 properties, | 149 properties, |
| 149 base::Bind(&IgnoreObjectPathCallback, callback), | 150 base::Bind(&IgnoreObjectPathCallback, callback), |
| 150 base::Bind(&network_handler::ShillErrorCallbackFunction, | 151 base::Bind(&network_handler::ShillErrorCallbackFunction, |
| 151 kLogModule, service_path, error_callback)); | 152 kLogModule, service_path, error_callback)); |
| 153 NetworkStateHandler::Get()->RequestUpdateForNetwork(service_path); | |
| 152 } | 154 } |
| 153 | 155 |
| 154 void NetworkConfigurationHandler::ClearProperties( | 156 void NetworkConfigurationHandler::ClearProperties( |
| 155 const std::string& service_path, | 157 const std::string& service_path, |
| 156 const std::vector<std::string>& names, | 158 const std::vector<std::string>& names, |
| 157 const base::Closure& callback, | 159 const base::Closure& callback, |
| 158 const network_handler::ErrorCallback& error_callback) { | 160 const network_handler::ErrorCallback& error_callback) { |
| 159 DBusThreadManager::Get()->GetShillServiceClient()->ClearProperties( | 161 DBusThreadManager::Get()->GetShillServiceClient()->ClearProperties( |
| 160 dbus::ObjectPath(service_path), | 162 dbus::ObjectPath(service_path), |
| 161 names, | 163 names, |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 190 properties, | 192 properties, |
| 191 base::Bind(&RunCreateNetworkCallback, callback), | 193 base::Bind(&RunCreateNetworkCallback, callback), |
| 192 base::Bind(&network_handler::ShillErrorCallbackFunction, | 194 base::Bind(&network_handler::ShillErrorCallbackFunction, |
| 193 kLogModule, "", error_callback)); | 195 kLogModule, "", error_callback)); |
| 194 } else { | 196 } else { |
| 195 manager->GetService( | 197 manager->GetService( |
| 196 properties, | 198 properties, |
| 197 base::Bind(&RunCreateNetworkCallback, callback), | 199 base::Bind(&RunCreateNetworkCallback, callback), |
| 198 base::Bind(&network_handler::ShillErrorCallbackFunction, | 200 base::Bind(&network_handler::ShillErrorCallbackFunction, |
| 199 kLogModule, "", error_callback)); | 201 kLogModule, "", error_callback)); |
| 200 } | 202 } |
|
pneubeck (no reviews)
2013/05/22 08:42:40
here configuration is also modified by profile/gui
stevenjb
2013/05/22 16:08:23
I'm not entirely sure that I follow.
This creates
pneubeck (no reviews)
2013/05/22 18:02:09
The name of the method is not identical to its usa
stevenjb
2013/05/22 18:45:35
Ah. Right, we talked about the need to fix this, p
| |
| 201 } | 203 } |
| 202 | 204 |
| 203 void NetworkConfigurationHandler::RemoveConfiguration( | 205 void NetworkConfigurationHandler::RemoveConfiguration( |
| 204 const std::string& service_path, | 206 const std::string& service_path, |
| 205 const base::Closure& callback, | 207 const base::Closure& callback, |
| 206 const network_handler::ErrorCallback& error_callback) const { | 208 const network_handler::ErrorCallback& error_callback) const { |
| 207 DBusThreadManager::Get()->GetShillServiceClient()->Remove( | 209 DBusThreadManager::Get()->GetShillServiceClient()->Remove( |
| 208 dbus::ObjectPath(service_path), | 210 dbus::ObjectPath(service_path), |
| 209 callback, | 211 callback, |
| 210 base::Bind(&network_handler::ShillErrorCallbackFunction, | 212 base::Bind(&network_handler::ShillErrorCallbackFunction, |
| 211 kLogModule, service_path, error_callback)); | 213 kLogModule, service_path, error_callback)); |
| 212 } | 214 } |
| 213 | 215 |
| 214 NetworkConfigurationHandler::NetworkConfigurationHandler() { | 216 NetworkConfigurationHandler::NetworkConfigurationHandler() { |
| 215 } | 217 } |
| 216 | 218 |
| 217 NetworkConfigurationHandler::~NetworkConfigurationHandler() { | 219 NetworkConfigurationHandler::~NetworkConfigurationHandler() { |
| 218 } | 220 } |
| 219 | 221 |
| 220 } // namespace chromeos | 222 } // namespace chromeos |
| OLD | NEW |