OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_CHROMEOS_EXTENSIONS_BLUETOOTH_EVENT_ROUTER_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_BLUETOOTH_EVENT_ROUTER_H_ |
| 7 #pragma once |
| 8 |
| 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "chrome/browser/chromeos/bluetooth/bluetooth_adapter.h" |
| 11 #include "chrome/browser/profiles/profile.h" |
| 12 |
| 13 namespace chromeos { |
| 14 |
| 15 class ExtensionBluetoothEventRouter |
| 16 : public chromeos::BluetoothAdapter::Observer { |
| 17 public: |
| 18 explicit ExtensionBluetoothEventRouter(Profile* profile); |
| 19 virtual ~ExtensionBluetoothEventRouter(); |
| 20 |
| 21 const chromeos::BluetoothAdapter* adapter() const { return adapter_.get(); } |
| 22 |
| 23 // Override from chromeos::BluetoothAdapter::Observer |
| 24 virtual void AdapterPresentChanged( |
| 25 chromeos::BluetoothAdapter* adapter, bool present) OVERRIDE; |
| 26 virtual void AdapterPoweredChanged( |
| 27 chromeos::BluetoothAdapter* adapter, bool has_power) OVERRIDE; |
| 28 private: |
| 29 void DispatchEvent(const char* event_name, bool value); |
| 30 |
| 31 Profile* profile_; |
| 32 scoped_ptr<chromeos::BluetoothAdapter> adapter_; |
| 33 DISALLOW_COPY_AND_ASSIGN(ExtensionBluetoothEventRouter); |
| 34 }; |
| 35 |
| 36 } // namespace chromeos |
| 37 |
| 38 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_BLUETOOTH_EVENT_ROUTER_H_ |
OLD | NEW |