OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_EXTENSIONS_API_BRAILLE_DISPLAY_PRIVATE_BRAILLE_CONTROLLER
_BRLAPI_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_BRAILLE_DISPLAY_PRIVATE_BRAILLE_CONTROLLER
_BRLAPI_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_API_BRAILLE_DISPLAY_PRIVATE_BRAILLE_CONTROLLER
_BRLAPI_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_BRAILLE_DISPLAY_PRIVATE_BRAILLE_CONTROLLER
_BRLAPI_H_ |
7 | 7 |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/files/file_path_watcher.h" | 9 #include "base/files/file_path_watcher.h" |
10 #include "base/gtest_prod_util.h" | 10 #include "base/gtest_prod_util.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "base/memory/singleton.h" | 12 #include "base/memory/singleton.h" |
13 #include "base/observer_list.h" | 13 #include "base/observer_list.h" |
14 #include "chrome/browser/extensions/api/braille_display_private/braille_controll
er.h" | 14 #include "chrome/browser/extensions/api/braille_display_private/braille_controll
er.h" |
15 #include "chrome/browser/extensions/api/braille_display_private/brlapi_connectio
n.h" | 15 #include "chrome/browser/extensions/api/braille_display_private/brlapi_connectio
n.h" |
16 #include "library_loaders/libbrlapi.h" | 16 #include "library_loaders/libbrlapi.h" |
17 | 17 |
18 namespace extensions { | 18 namespace extensions { |
19 namespace api { | 19 namespace api { |
20 namespace braille_display_private { | 20 namespace braille_display_private { |
21 | 21 |
22 // BrailleController implementation based on libbrlapi from brltty. | 22 // BrailleController implementation based on libbrlapi from brltty. |
23 class BrailleControllerImpl : public BrailleController { | 23 class BrailleControllerImpl : public BrailleController { |
24 public: | 24 public: |
25 static BrailleControllerImpl* GetInstance(); | 25 static BrailleControllerImpl* GetInstance(); |
26 scoped_ptr<DisplayState> GetDisplayState() override; | 26 scoped_ptr<DisplayState> GetDisplayState() override; |
27 void WriteDots(const std::string& cells) override; | 27 void WriteDots(const std::vector<char>& cells) override; |
28 void AddObserver(BrailleObserver* observer) override; | 28 void AddObserver(BrailleObserver* observer) override; |
29 void RemoveObserver(BrailleObserver* observer) override; | 29 void RemoveObserver(BrailleObserver* observer) override; |
30 | 30 |
31 private: | 31 private: |
32 // For the unit tests. | 32 // For the unit tests. |
33 friend class BrailleDisplayPrivateApiTest; | 33 friend class BrailleDisplayPrivateApiTest; |
34 friend class MockBrlapiConnection; | 34 friend class MockBrlapiConnection; |
35 | 35 |
36 BrailleControllerImpl(); | 36 BrailleControllerImpl(); |
37 ~BrailleControllerImpl() override; | 37 ~BrailleControllerImpl() override; |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 friend struct DefaultSingletonTraits<BrailleControllerImpl>; | 82 friend struct DefaultSingletonTraits<BrailleControllerImpl>; |
83 | 83 |
84 DISALLOW_COPY_AND_ASSIGN(BrailleControllerImpl); | 84 DISALLOW_COPY_AND_ASSIGN(BrailleControllerImpl); |
85 }; | 85 }; |
86 | 86 |
87 } // namespace braille_display_private | 87 } // namespace braille_display_private |
88 } // namespace api | 88 } // namespace api |
89 } // namespace extensions | 89 } // namespace extensions |
90 | 90 |
91 #endif // CHROME_BROWSER_EXTENSIONS_API_BRAILLE_DISPLAY_PRIVATE_BRAILLE_CONTROL
LER_BRLAPI_H_ | 91 #endif // CHROME_BROWSER_EXTENSIONS_API_BRAILLE_DISPLAY_PRIVATE_BRAILLE_CONTROL
LER_BRLAPI_H_ |
OLD | NEW |