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

Unified Diff: chrome/browser/extensions/api/braille_display_private/braille_controller_stub.cc

Issue 13355002: Implement chrome.brailleDisplayPrivate API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix stylistic issues from last review round. Created 7 years, 3 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_display_private/braille_controller_stub.cc
diff --git a/chrome/browser/extensions/api/braille_display_private/braille_controller_stub.cc b/chrome/browser/extensions/api/braille_display_private/braille_controller_stub.cc
new file mode 100644
index 0000000000000000000000000000000000000000..fc55189ce9623b3e14c3189badcabd83da697889
--- /dev/null
+++ b/chrome/browser/extensions/api/braille_display_private/braille_controller_stub.cc
@@ -0,0 +1,70 @@
+// 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.
+
+#include "chrome/browser/extensions/api/braille_display_private/braille_controller.h"
+
+#include "base/memory/scoped_ptr.h"
+#include "base/memory/singleton.h"
+#include "chrome/common/extensions/api/braille_display_private.h"
+
+namespace extensions {
+namespace api {
+namespace braille_display_private {
+
+// Stub implementation of BrailleController for use when brlapi is not
+// enabled.
+class BrailleControllerImpl : public BrailleController {
+ public:
+ static BrailleControllerImpl* GetInstance();
+ virtual scoped_ptr<base::DictionaryValue> GetDisplayState() OVERRIDE;
+ virtual void WriteDots(const std::string& cells) OVERRIDE;
+ virtual void AddObserver(BrailleObserver* observer) OVERRIDE;
+ virtual void RemoveObserver(BrailleObserver* observer) OVERRIDE;
+
+ private:
+ BrailleControllerImpl();
+ virtual ~BrailleControllerImpl();
+ friend struct DefaultSingletonTraits<BrailleControllerImpl>;
+ DISALLOW_COPY_AND_ASSIGN(BrailleControllerImpl);
+};
+
+BrailleController::BrailleController() {
+}
+
+BrailleController::~BrailleController() {
+}
+
+// static
+BrailleController* BrailleController::GetInstance() {
+ return BrailleControllerImpl::GetInstance();
+}
+
+BrailleControllerImpl::BrailleControllerImpl() {
+}
+
+BrailleControllerImpl::~BrailleControllerImpl() {
+}
+
+// static
+BrailleControllerImpl* BrailleControllerImpl::GetInstance() {
+ return Singleton<BrailleControllerImpl,
+ LeakySingletonTraits<BrailleControllerImpl> >::get();
+}
+
+scoped_ptr<base::DictionaryValue> BrailleControllerImpl::GetDisplayState() {
+ return DisplayState().ToValue().Pass();
+}
+
+void BrailleControllerImpl::WriteDots(const std::string& cells) {
+}
+
+void BrailleControllerImpl::AddObserver(BrailleObserver* observer) {
+}
+
+void BrailleControllerImpl::RemoveObserver(BrailleObserver* observer) {
+}
+
+} // namespace braille_display_private
+} // namespace api
+} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698