Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(265)

Side by Side Diff: chromeos/dbus/fake_nfc_adapter_client.cc

Issue 131103007: Add chrome://nfc-debug for debugging NFC on Chrome OS. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed thaki@'s comment. Fixed a couple of minor issues. Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/common/url_constants.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/fake_nfc_adapter_client.h" 5 #include "chromeos/dbus/fake_nfc_adapter_client.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "chromeos/dbus/dbus_thread_manager.h" 8 #include "chromeos/dbus/dbus_thread_manager.h"
9 #include "chromeos/dbus/fake_nfc_device_client.h" 9 #include "chromeos/dbus/fake_nfc_device_client.h"
10 #include "chromeos/dbus/fake_nfc_tag_client.h" 10 #include "chromeos/dbus/fake_nfc_tag_client.h"
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 // Mark as polling. 290 // Mark as polling.
291 DCHECK(!properties_->polling.value()); 291 DCHECK(!properties_->polling.value());
292 properties_->polling.ReplaceValue(true); 292 properties_->polling.ReplaceValue(true);
293 return; 293 return;
294 } 294 }
295 } 295 }
296 LOG(WARNING) << "Device path not in list of devices."; 296 LOG(WARNING) << "Device path not in list of devices.";
297 } 297 }
298 298
299 void FakeNfcAdapterClient::UnsetTag(const dbus::ObjectPath& tag_path) { 299 void FakeNfcAdapterClient::UnsetTag(const dbus::ObjectPath& tag_path) {
300 LOG(INFO) << "Add tag path to the fake adapter: " << tag_path.value(); 300 LOG(INFO) << "Remove tag path from the fake adapter: " << tag_path.value();
301 ObjectPathVector new_tags = properties_->tags.value(); 301 ObjectPathVector new_tags = properties_->tags.value();
302 for (ObjectPathVector::iterator iter = new_tags.begin(); 302 for (ObjectPathVector::iterator iter = new_tags.begin();
303 iter != new_tags.end(); ++iter) { 303 iter != new_tags.end(); ++iter) {
304 if (*iter == tag_path) { 304 if (*iter == tag_path) {
305 new_tags.erase(iter); 305 new_tags.erase(iter);
306 properties_->tags.ReplaceValue(new_tags); 306 properties_->tags.ReplaceValue(new_tags);
307 307
308 // Mark as polling. 308 // Mark as polling.
309 DCHECK(!properties_->polling.value()); 309 DCHECK(!properties_->polling.value());
310 properties_->polling.ReplaceValue(true); 310 properties_->polling.ReplaceValue(true);
311 return; 311 return;
312 } 312 }
313 } 313 }
314 LOG(WARNING) << "Tag path not in list of tags."; 314 LOG(WARNING) << "Tag path not in list of tags.";
315 } 315 }
316 316
317 void FakeNfcAdapterClient::EnablePairingOnPoll(bool enabled) { 317 void FakeNfcAdapterClient::EnablePairingOnPoll(bool enabled) {
318 start_pairing_on_poll_ = enabled; 318 start_pairing_on_poll_ = enabled;
319 } 319 }
320 320
321 void FakeNfcAdapterClient::OnPropertyChanged( 321 void FakeNfcAdapterClient::OnPropertyChanged(
322 const dbus::ObjectPath& object_path, 322 const dbus::ObjectPath& object_path,
323 const std::string& property_name) { 323 const std::string& property_name) {
324 FOR_EACH_OBSERVER(NfcAdapterClient::Observer, observers_, 324 FOR_EACH_OBSERVER(NfcAdapterClient::Observer, observers_,
325 AdapterPropertyChanged(object_path, property_name)); 325 AdapterPropertyChanged(object_path, property_name));
326 } 326 }
327 327
328 } // namespace chromeos 328 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/common/url_constants.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698