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

Unified Diff: chrome/browser/extensions/api/braille_private/braille_controller.h

Issue 13355002: Implement chrome.brailleDisplayPrivate API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 4 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/extensions/api/braille_private/braille_controller.h
diff --git a/chrome/browser/extensions/api/braille_private/braille_controller.h b/chrome/browser/extensions/api/braille_private/braille_controller.h
new file mode 100644
index 0000000000000000000000000000000000000000..8acac85597fd6e6c29de7568c0f1d65debbc4231
--- /dev/null
+++ b/chrome/browser/extensions/api/braille_private/braille_controller.h
@@ -0,0 +1,45 @@
+// Copyright (c) 2013 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_EXTENSIONS_API_BRAILLE_PRIVATE_BRAILLE_CONTROLLER_H_
+#define CHROME_BROWSER_EXTENSIONS_API_BRAILLE_PRIVATE_BRAILLE_CONTROLLER_H_
+
+#include <string>
+
+#include "base/basictypes.h"
+#include "base/memory/scoped_ptr.h"
+#include "base/values.h"
+
+namespace extensions {
+namespace api {
+namespace braille_private {
+class BrailleController {
+ public:
+ class Observer {
+ public:
+ virtual void OnKeyEvent(scoped_ptr<base::DictionaryValue> event) {};
+ };
+
+ static void AddWindow(unsigned long windowId);
+ static void RemoveWindow(unsigned long windowId);
+ static BrailleController* GetInstance();
+
+ virtual scoped_ptr<base::DictionaryValue> GetDisplayState() = 0;
+ virtual void WriteText(const std::string& text, int cursor) = 0;
+ virtual void AddObserver(Observer* observer) = 0;
+ virtual void RemoveObserver(Observer* observer) = 0;
+
+ protected:
+ BrailleController();
+ virtual ~BrailleController();
+ virtual void AddWindowOnIOThread(unsigned long windowId) = 0;
+ virtual void RemoveWindowOnIOThread(unsigned long windowId) = 0;
+ private:
+ DISALLOW_COPY_AND_ASSIGN(BrailleController);
+};
+} // namespace braille_private
+} // namespace api
+} // namespace extensions
+
+#endif // CHROME_BROWSER_EXTENSIONS_API_BRAILLE_PRIVATE_BRAILLE_CONTROLLER_H_

Powered by Google App Engine
This is Rietveld 408576698