OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/nfc_manager_client.h" | 5 #include "chromeos/dbus/nfc_manager_client.h" |
6 | 6 |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
9 #include "base/observer_list.h" | 9 #include "base/observer_list.h" |
10 #include "dbus/bus.h" | 10 #include "dbus/bus.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 public: | 30 public: |
31 NfcManagerClientImpl() | 31 NfcManagerClientImpl() |
32 : object_proxy_(NULL), | 32 : object_proxy_(NULL), |
33 weak_ptr_factory_(this) { | 33 weak_ptr_factory_(this) { |
34 } | 34 } |
35 | 35 |
36 virtual ~NfcManagerClientImpl() { | 36 virtual ~NfcManagerClientImpl() { |
37 } | 37 } |
38 | 38 |
39 // NfcManagerClient override. | 39 // NfcManagerClient override. |
40 virtual void AddObserver(Observer* observer) OVERRIDE { | 40 virtual void AddObserver(Observer* observer) override { |
41 DCHECK(observer); | 41 DCHECK(observer); |
42 observers_.AddObserver(observer); | 42 observers_.AddObserver(observer); |
43 } | 43 } |
44 | 44 |
45 // NfcManagerClient override. | 45 // NfcManagerClient override. |
46 virtual void RemoveObserver(Observer* observer) OVERRIDE { | 46 virtual void RemoveObserver(Observer* observer) override { |
47 DCHECK(observer); | 47 DCHECK(observer); |
48 observers_.RemoveObserver(observer); | 48 observers_.RemoveObserver(observer); |
49 } | 49 } |
50 | 50 |
51 // NfcManagerClient override. | 51 // NfcManagerClient override. |
52 virtual Properties* GetProperties() OVERRIDE { | 52 virtual Properties* GetProperties() override { |
53 return properties_.get(); | 53 return properties_.get(); |
54 } | 54 } |
55 | 55 |
56 protected: | 56 protected: |
57 // DBusClient override. | 57 // DBusClient override. |
58 virtual void Init(dbus::Bus* bus) OVERRIDE { | 58 virtual void Init(dbus::Bus* bus) override { |
59 VLOG(1) << "Creating NfcManagerClientImpl"; | 59 VLOG(1) << "Creating NfcManagerClientImpl"; |
60 | 60 |
61 // Create the object proxy. | 61 // Create the object proxy. |
62 object_proxy_ = bus->GetObjectProxy( | 62 object_proxy_ = bus->GetObjectProxy( |
63 nfc_manager::kNfcManagerServiceName, | 63 nfc_manager::kNfcManagerServiceName, |
64 dbus::ObjectPath(nfc_manager::kNfcManagerServicePath)); | 64 dbus::ObjectPath(nfc_manager::kNfcManagerServicePath)); |
65 | 65 |
66 // Set up the signal handlers. | 66 // Set up the signal handlers. |
67 object_proxy_->ConnectToSignal( | 67 object_proxy_->ConnectToSignal( |
68 nfc_manager::kNfcManagerInterface, | 68 nfc_manager::kNfcManagerInterface, |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 | 163 |
164 NfcManagerClient::~NfcManagerClient() { | 164 NfcManagerClient::~NfcManagerClient() { |
165 } | 165 } |
166 | 166 |
167 // static | 167 // static |
168 NfcManagerClient* NfcManagerClient::Create() { | 168 NfcManagerClient* NfcManagerClient::Create() { |
169 return new NfcManagerClientImpl(); | 169 return new NfcManagerClientImpl(); |
170 } | 170 } |
171 | 171 |
172 } // namespace chromeos | 172 } // namespace chromeos |
OLD | NEW |