Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / chrome / browser / extensions / api / braille_display_private / mock_braille_controller.cc
blobe0413cfc3ed75e0416341b5e5f51e8a3c67dc004
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "chrome/browser/extensions/api/braille_display_private/mock_braille_controller.h"
7 namespace extensions {
8 namespace api {
9 namespace braille_display_private {
11 MockBrailleController::MockBrailleController()
12 : available_(false), observer_(NULL) {}
14 scoped_ptr<DisplayState> MockBrailleController::GetDisplayState() {
15 scoped_ptr<DisplayState> state(new DisplayState());
16 state->available = available_;
17 if (available_)
18 state->text_cell_count.reset(new int(18));
19 return state.Pass();
22 void MockBrailleController::AddObserver(BrailleObserver* observer) {
23 CHECK(observer_ == NULL);
24 observer_ = observer;
27 void MockBrailleController::RemoveObserver(BrailleObserver* observer) {
28 CHECK(observer == observer_);
29 observer_ = NULL;
32 void MockBrailleController::SetAvailable(bool available) {
33 available_ = available;
36 BrailleObserver* MockBrailleController::GetObserver() const {
37 return observer_;
40 } // namespace braille_display_private
41 } // namespace api
42 } // namespace extensions