summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/api/braille_display_private/mock_braille_controller.h
blob: 9ce52bc9967715e57e5532add563b9eb4971bb5e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// 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.

#ifndef CHROME_BROWSER_EXTENSIONS_API_BRAILLE_DISPLAY_PRIVATE_MOCK_BRAILLE_CONTROLLER_H_
#define CHROME_BROWSER_EXTENSIONS_API_BRAILLE_DISPLAY_PRIVATE_MOCK_BRAILLE_CONTROLLER_H_

#include "chrome/browser/extensions/api/braille_display_private/stub_braille_controller.h"

namespace extensions {
namespace api {
namespace braille_display_private {

// Mock implementation of the BrailleController interface.
class MockBrailleController : public StubBrailleController {
 public:
  MockBrailleController();

  scoped_ptr<DisplayState> GetDisplayState() override;
  void AddObserver(BrailleObserver* observer) override;
  void RemoveObserver(BrailleObserver* observer) override;

  // Sets the available flag without calling the observer.
  void SetAvailable(bool available);
  BrailleObserver* GetObserver() const;

 private:
  bool available_;
  BrailleObserver* observer_;
};

}  // namespace braille_display_private
}  // namespace api
}  // namespace extensions

#endif  // CHROME_BROWSER_EXTENSIONS_API_BRAILLE_DISPLAY_PRIVATE_MOCK_BRAILLE_CONTROLLER_H_