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_profile_client.h" | 5 #include "chromeos/dbus/shill_profile_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 10 matching lines...) Expand all Loading... |
21 namespace { | 21 namespace { |
22 | 22 |
23 const char kSharedProfilePath[] = "/profile/default"; | 23 const char kSharedProfilePath[] = "/profile/default"; |
24 | 24 |
25 class ShillProfileClientImpl : public ShillProfileClient { | 25 class ShillProfileClientImpl : public ShillProfileClient { |
26 public: | 26 public: |
27 ShillProfileClientImpl(); | 27 ShillProfileClientImpl(); |
28 | 28 |
29 virtual void AddPropertyChangedObserver( | 29 virtual void AddPropertyChangedObserver( |
30 const dbus::ObjectPath& profile_path, | 30 const dbus::ObjectPath& profile_path, |
31 ShillPropertyChangedObserver* observer) OVERRIDE { | 31 ShillPropertyChangedObserver* observer) override { |
32 GetHelper(profile_path)->AddPropertyChangedObserver(observer); | 32 GetHelper(profile_path)->AddPropertyChangedObserver(observer); |
33 } | 33 } |
34 | 34 |
35 virtual void RemovePropertyChangedObserver( | 35 virtual void RemovePropertyChangedObserver( |
36 const dbus::ObjectPath& profile_path, | 36 const dbus::ObjectPath& profile_path, |
37 ShillPropertyChangedObserver* observer) OVERRIDE { | 37 ShillPropertyChangedObserver* observer) override { |
38 GetHelper(profile_path)->RemovePropertyChangedObserver(observer); | 38 GetHelper(profile_path)->RemovePropertyChangedObserver(observer); |
39 } | 39 } |
40 | 40 |
41 virtual void GetProperties( | 41 virtual void GetProperties( |
42 const dbus::ObjectPath& profile_path, | 42 const dbus::ObjectPath& profile_path, |
43 const DictionaryValueCallbackWithoutStatus& callback, | 43 const DictionaryValueCallbackWithoutStatus& callback, |
44 const ErrorCallback& error_callback) OVERRIDE; | 44 const ErrorCallback& error_callback) override; |
45 virtual void GetEntry(const dbus::ObjectPath& profile_path, | 45 virtual void GetEntry(const dbus::ObjectPath& profile_path, |
46 const std::string& entry_path, | 46 const std::string& entry_path, |
47 const DictionaryValueCallbackWithoutStatus& callback, | 47 const DictionaryValueCallbackWithoutStatus& callback, |
48 const ErrorCallback& error_callback) OVERRIDE; | 48 const ErrorCallback& error_callback) override; |
49 virtual void DeleteEntry(const dbus::ObjectPath& profile_path, | 49 virtual void DeleteEntry(const dbus::ObjectPath& profile_path, |
50 const std::string& entry_path, | 50 const std::string& entry_path, |
51 const base::Closure& callback, | 51 const base::Closure& callback, |
52 const ErrorCallback& error_callback) OVERRIDE; | 52 const ErrorCallback& error_callback) override; |
53 | 53 |
54 virtual TestInterface* GetTestInterface() OVERRIDE { | 54 virtual TestInterface* GetTestInterface() override { |
55 return NULL; | 55 return NULL; |
56 } | 56 } |
57 | 57 |
58 protected: | 58 protected: |
59 virtual void Init(dbus::Bus* bus) OVERRIDE { | 59 virtual void Init(dbus::Bus* bus) override { |
60 bus_ = bus; | 60 bus_ = bus; |
61 } | 61 } |
62 | 62 |
63 private: | 63 private: |
64 typedef std::map<std::string, ShillClientHelper*> HelperMap; | 64 typedef std::map<std::string, ShillClientHelper*> HelperMap; |
65 | 65 |
66 // Returns the corresponding ShillClientHelper for the profile. | 66 // Returns the corresponding ShillClientHelper for the profile. |
67 ShillClientHelper* GetHelper(const dbus::ObjectPath& profile_path); | 67 ShillClientHelper* GetHelper(const dbus::ObjectPath& profile_path); |
68 | 68 |
69 dbus::Bus* bus_; | 69 dbus::Bus* bus_; |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 ShillProfileClient* ShillProfileClient::Create() { | 139 ShillProfileClient* ShillProfileClient::Create() { |
140 return new ShillProfileClientImpl(); | 140 return new ShillProfileClientImpl(); |
141 } | 141 } |
142 | 142 |
143 // static | 143 // static |
144 std::string ShillProfileClient::GetSharedProfilePath() { | 144 std::string ShillProfileClient::GetSharedProfilePath() { |
145 return std::string(kSharedProfilePath); | 145 return std::string(kSharedProfilePath); |
146 } | 146 } |
147 | 147 |
148 } // namespace chromeos | 148 } // namespace chromeos |
OLD | NEW |