OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chrome/browser/ui/webui/chromeos/nfc_debug_ui.h" | 5 #include "chrome/browser/ui/webui/chromeos/nfc_debug_ui.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 class NfcDebugMessageHandler : public content::WebUIMessageHandler, | 178 class NfcDebugMessageHandler : public content::WebUIMessageHandler, |
179 public NfcAdapter::Observer, | 179 public NfcAdapter::Observer, |
180 public NfcNdefTagTechnology::Observer, | 180 public NfcNdefTagTechnology::Observer, |
181 public NfcPeer::Observer, | 181 public NfcPeer::Observer, |
182 public NfcTag::Observer { | 182 public NfcTag::Observer { |
183 public: | 183 public: |
184 NfcDebugMessageHandler(); | 184 NfcDebugMessageHandler(); |
185 virtual ~NfcDebugMessageHandler(); | 185 virtual ~NfcDebugMessageHandler(); |
186 | 186 |
187 // WebUIMessageHandler implementation. | 187 // WebUIMessageHandler implementation. |
188 virtual void RegisterMessages() OVERRIDE; | 188 virtual void RegisterMessages() override; |
189 | 189 |
190 // NfcAdapter::Observer overrides. | 190 // NfcAdapter::Observer overrides. |
191 virtual void AdapterPresentChanged( | 191 virtual void AdapterPresentChanged( |
192 NfcAdapter* adapter, | 192 NfcAdapter* adapter, |
193 bool present) OVERRIDE; | 193 bool present) override; |
194 virtual void AdapterPoweredChanged( | 194 virtual void AdapterPoweredChanged( |
195 NfcAdapter* adapter, | 195 NfcAdapter* adapter, |
196 bool powered) OVERRIDE; | 196 bool powered) override; |
197 virtual void AdapterPollingChanged( | 197 virtual void AdapterPollingChanged( |
198 NfcAdapter* adapter, | 198 NfcAdapter* adapter, |
199 bool polling) OVERRIDE; | 199 bool polling) override; |
200 virtual void TagFound(NfcAdapter* adapter, NfcTag* tag) OVERRIDE; | 200 virtual void TagFound(NfcAdapter* adapter, NfcTag* tag) override; |
201 virtual void TagLost(NfcAdapter*adapter, NfcTag* tag) OVERRIDE; | 201 virtual void TagLost(NfcAdapter*adapter, NfcTag* tag) override; |
202 virtual void PeerFound(NfcAdapter* adaper, NfcPeer* peer) OVERRIDE; | 202 virtual void PeerFound(NfcAdapter* adaper, NfcPeer* peer) override; |
203 virtual void PeerLost(NfcAdapter* adapter, NfcPeer* peer) OVERRIDE; | 203 virtual void PeerLost(NfcAdapter* adapter, NfcPeer* peer) override; |
204 | 204 |
205 // NfcNdefTagTechnology::Observer override. | 205 // NfcNdefTagTechnology::Observer override. |
206 virtual void RecordReceived( | 206 virtual void RecordReceived( |
207 NfcTag* tag, | 207 NfcTag* tag, |
208 const NfcNdefRecord* record) OVERRIDE; | 208 const NfcNdefRecord* record) override; |
209 | 209 |
210 // NfcPeer::Observer override. | 210 // NfcPeer::Observer override. |
211 virtual void RecordReceived( | 211 virtual void RecordReceived( |
212 NfcPeer* peer, | 212 NfcPeer* peer, |
213 const NfcNdefRecord* record) OVERRIDE; | 213 const NfcNdefRecord* record) override; |
214 | 214 |
215 // NfcTag::Observer override. | 215 // NfcTag::Observer override. |
216 virtual void TagReady(NfcTag* tag) OVERRIDE; | 216 virtual void TagReady(NfcTag* tag) override; |
217 | 217 |
218 private: | 218 private: |
219 // Called by the UI when the page loads. This method requests information | 219 // Called by the UI when the page loads. This method requests information |
220 // about NFC availability on the current platform and requests the underlying | 220 // about NFC availability on the current platform and requests the underlying |
221 // Adapter object. The UI is notified once the information is available. | 221 // Adapter object. The UI is notified once the information is available. |
222 void Initialize(const base::ListValue* args); | 222 void Initialize(const base::ListValue* args); |
223 | 223 |
224 // Called by the UI to toggle the adapter power. |args| will contain one | 224 // Called by the UI to toggle the adapter power. |args| will contain one |
225 // boolean that indicates whether the power should be set to ON or OFF. | 225 // boolean that indicates whether the power should be set to ON or OFF. |
226 void SetAdapterPower(const base::ListValue* args); | 226 void SetAdapterPower(const base::ListValue* args); |
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
742 html_source->SetDefaultResource(IDR_NFC_DEBUG_HTML); | 742 html_source->SetDefaultResource(IDR_NFC_DEBUG_HTML); |
743 | 743 |
744 Profile* profile = Profile::FromWebUI(web_ui); | 744 Profile* profile = Profile::FromWebUI(web_ui); |
745 content::WebUIDataSource::Add(profile, html_source); | 745 content::WebUIDataSource::Add(profile, html_source); |
746 } | 746 } |
747 | 747 |
748 NfcDebugUI::~NfcDebugUI() { | 748 NfcDebugUI::~NfcDebugUI() { |
749 } | 749 } |
750 | 750 |
751 } // namespace chromeos | 751 } // namespace chromeos |
OLD | NEW |