Add ICU message format support
[chromium-blink-merge.git] / extensions / browser / api / bluetooth / bluetooth_extension_function.h
blobc09e8c8053f8c8d4ffb5157706081622367b13e8
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.
5 #ifndef EXTENSIONS_BROWSER_API_BLUETOOTH_BLUETOOTH_EXTENSION_FUNCTION_H_
6 #define EXTENSIONS_BROWSER_API_BLUETOOTH_BLUETOOTH_EXTENSION_FUNCTION_H_
8 #include "base/memory/ref_counted.h"
9 #include "base/memory/weak_ptr.h"
10 #include "extensions/browser/extension_function.h"
12 namespace device {
14 class BluetoothAdapter;
16 } // namespace device
18 namespace extensions {
19 namespace api {
21 // Base class for bluetooth extension functions. This class initializes
22 // bluetooth adapter and calls (on the UI thread) DoWork() implemented by
23 // individual bluetooth extension functions.
24 class BluetoothExtensionFunction : public AsyncExtensionFunction {
25 public:
26 BluetoothExtensionFunction();
28 protected:
29 ~BluetoothExtensionFunction() override;
31 // ExtensionFunction:
32 bool RunAsync() override;
34 private:
35 void RunOnAdapterReady(scoped_refptr<device::BluetoothAdapter> adapter);
37 // Implemented by individual bluetooth extension functions, called
38 // automatically on the UI thread once |adapter| has been initialized.
39 virtual bool DoWork(scoped_refptr<device::BluetoothAdapter> adapter) = 0;
41 DISALLOW_COPY_AND_ASSIGN(BluetoothExtensionFunction);
44 } // namespace api
45 } // namespace extensions
47 #endif // EXTENSIONS_BROWSER_API_BLUETOOTH_BLUETOOTH_EXTENSION_FUNCTION_H_