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

Unified Diff: chrome/browser/chromeos/extensions/bluetooth_event_router.h

Issue 9822001: Basic infrastructure for the Bluetooth API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more review comments Created 8 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/extensions/bluetooth_event_router.h
diff --git a/chrome/browser/chromeos/extensions/bluetooth_event_router.h b/chrome/browser/chromeos/extensions/bluetooth_event_router.h
new file mode 100644
index 0000000000000000000000000000000000000000..6fa34581682ea97ba0a75ff16e6fe7f2a76a02db
--- /dev/null
+++ b/chrome/browser/chromeos/extensions/bluetooth_event_router.h
@@ -0,0 +1,38 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_CHROMEOS_EXTENSIONS_BLUETOOTH_EVENT_ROUTER_H_
+#define CHROME_BROWSER_CHROMEOS_EXTENSIONS_BLUETOOTH_EVENT_ROUTER_H_
+#pragma once
+
+#include "base/memory/scoped_ptr.h"
+#include "chrome/browser/chromeos/bluetooth/bluetooth_adapter.h"
+#include "chrome/browser/profiles/profile.h"
+
+namespace chromeos {
+
+class ExtensionBluetoothEventRouter
+ : public chromeos::BluetoothAdapter::Observer {
+ public:
+ explicit ExtensionBluetoothEventRouter(Profile* profile);
+ virtual ~ExtensionBluetoothEventRouter();
+
+ const chromeos::BluetoothAdapter* adapter() const { return adapter_.get(); }
+
+ // Override from chromeos::BluetoothAdapter::Observer
+ virtual void AdapterPresentChanged(
+ chromeos::BluetoothAdapter* adapter, bool present) OVERRIDE;
+ virtual void AdapterPoweredChanged(
+ chromeos::BluetoothAdapter* adapter, bool has_power) OVERRIDE;
+ private:
+ void DispatchEvent(const char* event_name, bool value);
+
+ Profile* profile_;
+ scoped_ptr<chromeos::BluetoothAdapter> adapter_;
+ DISALLOW_COPY_AND_ASSIGN(ExtensionBluetoothEventRouter);
+};
+
+} // namespace chromeos
+
+#endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_BLUETOOTH_EVENT_ROUTER_H_

Powered by Google App Engine
This is Rietveld 408576698