| 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..00686b427953c73472e65179da6dd8edcbffb595
|
| --- /dev/null
|
| +++ b/chrome/browser/extensions/api/braille_display_private/mock_braille_controller.cc
|
| @@ -0,0 +1,40 @@
|
| +// 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() { return observer_; }
|
| +
|
| +} // namespace braille_display_private
|
| +} // namespace api
|
| +} // namespace extensions
|
|
|