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_ipconfig_client.h" | 5 #include "chromeos/dbus/shill_ipconfig_client.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 | 63 |
64 // Returns the corresponding ShillClientHelper for the profile. | 64 // Returns the corresponding ShillClientHelper for the profile. |
65 ShillClientHelper* GetHelper(const dbus::ObjectPath& ipconfig_path) { | 65 ShillClientHelper* GetHelper(const dbus::ObjectPath& ipconfig_path) { |
66 HelperMap::iterator it = helpers_.find(ipconfig_path.value()); | 66 HelperMap::iterator it = helpers_.find(ipconfig_path.value()); |
67 if (it != helpers_.end()) | 67 if (it != helpers_.end()) |
68 return it->second; | 68 return it->second; |
69 | 69 |
70 // There is no helper for the profile, create it. | 70 // There is no helper for the profile, create it. |
71 dbus::ObjectProxy* object_proxy = | 71 dbus::ObjectProxy* object_proxy = |
72 bus_->GetObjectProxy(flimflam::kFlimflamServiceName, ipconfig_path); | 72 bus_->GetObjectProxy(flimflam::kFlimflamServiceName, ipconfig_path); |
73 ShillClientHelper* helper = new ShillClientHelper(bus_, object_proxy); | 73 ShillClientHelper* helper = new ShillClientHelper(object_proxy); |
74 helper->MonitorPropertyChanged(flimflam::kFlimflamIPConfigInterface); | 74 helper->MonitorPropertyChanged(flimflam::kFlimflamIPConfigInterface); |
75 helpers_.insert(HelperMap::value_type(ipconfig_path.value(), helper)); | 75 helpers_.insert(HelperMap::value_type(ipconfig_path.value(), helper)); |
76 return helper; | 76 return helper; |
77 } | 77 } |
78 | 78 |
79 dbus::Bus* bus_; | 79 dbus::Bus* bus_; |
80 HelperMap helpers_; | 80 HelperMap helpers_; |
81 STLValueDeleter<HelperMap> helpers_deleter_; | 81 STLValueDeleter<HelperMap> helpers_deleter_; |
82 | 82 |
83 DISALLOW_COPY_AND_ASSIGN(ShillIPConfigClientImpl); | 83 DISALLOW_COPY_AND_ASSIGN(ShillIPConfigClientImpl); |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 // static | 174 // static |
175 ShillIPConfigClient* ShillIPConfigClient::Create( | 175 ShillIPConfigClient* ShillIPConfigClient::Create( |
176 DBusClientImplementationType type) { | 176 DBusClientImplementationType type) { |
177 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION) | 177 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION) |
178 return new ShillIPConfigClientImpl(); | 178 return new ShillIPConfigClientImpl(); |
179 DCHECK_EQ(STUB_DBUS_CLIENT_IMPLEMENTATION, type); | 179 DCHECK_EQ(STUB_DBUS_CLIENT_IMPLEMENTATION, type); |
180 return new ShillIPConfigClientStub(); | 180 return new ShillIPConfigClientStub(); |
181 } | 181 } |
182 | 182 |
183 } // namespace chromeos | 183 } // namespace chromeos |
OLD | NEW |