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

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

Issue 13927010: Bluetooth: implement BlueZ 5 backend for Chrome OS (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix review comment Created 7 years, 8 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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/experimental_bluetooth_agent_service_provider.h" 5 #include "chromeos/dbus/experimental_bluetooth_agent_service_provider.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/chromeos/chromeos_version.h" 10 #include "base/chromeos/chromeos_version.h"
11 #include "base/logging.h" 11 #include "base/logging.h"
12 #include "base/memory/ref_counted.h" 12 #include "base/memory/ref_counted.h"
13 #include "base/threading/platform_thread.h" 13 #include "base/threading/platform_thread.h"
14 #include "chromeos/dbus/fake_bluetooth_agent_service_provider.h"
14 #include "dbus/bus.h" 15 #include "dbus/bus.h"
15 #include "dbus/exported_object.h" 16 #include "dbus/exported_object.h"
16 #include "dbus/message.h" 17 #include "dbus/message.h"
17 #include "dbus/object_path.h" 18 #include "dbus/object_path.h"
18 #include "third_party/cros_system_api/dbus/service_constants.h" 19 #include "third_party/cros_system_api/dbus/service_constants.h"
19 20
20 namespace chromeos { 21 namespace chromeos {
21 22
22 // The ExperimentalBluetoothAgentServiceProvider implementation used in 23 // The ExperimentalBluetoothAgentServiceProvider implementation used in
23 // production. 24 // production.
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
474 // Weak pointer factory for generating 'this' pointers that might live longer 475 // Weak pointer factory for generating 'this' pointers that might live longer
475 // than we do. 476 // than we do.
476 // Note: This should remain the last member so it'll be destroyed and 477 // Note: This should remain the last member so it'll be destroyed and
477 // invalidate its weak pointers before any other members are destroyed. 478 // invalidate its weak pointers before any other members are destroyed.
478 base::WeakPtrFactory<ExperimentalBluetoothAgentServiceProviderImpl> 479 base::WeakPtrFactory<ExperimentalBluetoothAgentServiceProviderImpl>
479 weak_ptr_factory_; 480 weak_ptr_factory_;
480 481
481 DISALLOW_COPY_AND_ASSIGN(ExperimentalBluetoothAgentServiceProviderImpl); 482 DISALLOW_COPY_AND_ASSIGN(ExperimentalBluetoothAgentServiceProviderImpl);
482 }; 483 };
483 484
484 // The ExperimentalBluetoothAgentServiceProvider implementation used on Linux
485 // desktop, which does nothing.
486 class ExperimentalBluetoothAgentServiceProviderStubImpl
487 : public ExperimentalBluetoothAgentServiceProvider {
488 public:
489 explicit ExperimentalBluetoothAgentServiceProviderStubImpl(
490 Delegate* delegate) {
491 }
492
493 virtual ~ExperimentalBluetoothAgentServiceProviderStubImpl() {
494 }
495 };
496
497 ExperimentalBluetoothAgentServiceProvider:: 485 ExperimentalBluetoothAgentServiceProvider::
498 ExperimentalBluetoothAgentServiceProvider() { 486 ExperimentalBluetoothAgentServiceProvider() {
499 } 487 }
500 488
501 ExperimentalBluetoothAgentServiceProvider:: 489 ExperimentalBluetoothAgentServiceProvider::
502 ~ExperimentalBluetoothAgentServiceProvider() { 490 ~ExperimentalBluetoothAgentServiceProvider() {
503 } 491 }
504 492
505 // static 493 // static
506 ExperimentalBluetoothAgentServiceProvider* 494 ExperimentalBluetoothAgentServiceProvider*
507 ExperimentalBluetoothAgentServiceProvider::Create( 495 ExperimentalBluetoothAgentServiceProvider::Create(
508 dbus::Bus* bus, 496 dbus::Bus* bus,
509 const dbus::ObjectPath& object_path, 497 const dbus::ObjectPath& object_path,
510 Delegate* delegate) { 498 Delegate* delegate) {
511 if (base::chromeos::IsRunningOnChromeOS()) { 499 if (base::chromeos::IsRunningOnChromeOS()) {
512 return new ExperimentalBluetoothAgentServiceProviderImpl( 500 return new ExperimentalBluetoothAgentServiceProviderImpl(
513 bus, object_path, delegate); 501 bus, object_path, delegate);
514 } else { 502 } else {
515 return new ExperimentalBluetoothAgentServiceProviderStubImpl(delegate); 503 return new FakeBluetoothAgentServiceProvider(object_path, delegate);
516 } 504 }
517 } 505 }
518 506
519 } // namespace chromeos 507 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/dbus/experimental_bluetooth_agent_manager_client.cc ('k') | chromeos/dbus/experimental_bluetooth_device_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698