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

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

Issue 213233003: Show a notification when a braille display is connected. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Style and const correctness fixes. Created 6 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/extensions/api/braille_display_private/mock_braille_controller.cc
diff --git a/chrome/browser/extensions/api/braille_display_private/mock_braille_controller.cc b/chrome/browser/extensions/api/braille_display_private/mock_braille_controller.cc
new file mode 100644
index 0000000000000000000000000000000000000000..e0413cfc3ed75e0416341b5e5f51e8a3c67dc004
--- /dev/null
+++ b/chrome/browser/extensions/api/braille_display_private/mock_braille_controller.cc
@@ -0,0 +1,42 @@
+// Copyright 2014 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/mock_braille_controller.h"
+
+namespace extensions {
+namespace api {
+namespace braille_display_private {
+
+MockBrailleController::MockBrailleController()
+ : available_(false), observer_(NULL) {}
+
+scoped_ptr<DisplayState> MockBrailleController::GetDisplayState() {
+ scoped_ptr<DisplayState> state(new DisplayState());
+ state->available = available_;
+ if (available_)
+ state->text_cell_count.reset(new int(18));
+ return state.Pass();
+}
+
+void MockBrailleController::AddObserver(BrailleObserver* observer) {
+ CHECK(observer_ == NULL);
+ observer_ = observer;
+}
+
+void MockBrailleController::RemoveObserver(BrailleObserver* observer) {
+ CHECK(observer == observer_);
+ observer_ = NULL;
+}
+
+void MockBrailleController::SetAvailable(bool available) {
+ available_ = available;
+}
+
+BrailleObserver* MockBrailleController::GetObserver() const {
+ return observer_;
+}
+
+} // namespace braille_display_private
+} // namespace api
+} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698