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 #include "chrome/browser/extensions/api/braille_display_private/braille_controll
er.h" | 5 #include "chrome/browser/extensions/api/braille_display_private/braille_controll
er.h" |
6 | 6 |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "base/memory/singleton.h" | 8 #include "base/memory/singleton.h" |
9 #include "chrome/common/extensions/api/braille_display_private.h" | 9 #include "chrome/common/extensions/api/braille_display_private.h" |
10 | 10 |
11 namespace extensions { | 11 namespace extensions { |
12 namespace api { | 12 namespace api { |
13 namespace braille_display_private { | 13 namespace braille_display_private { |
14 | 14 |
15 // Stub implementation of BrailleController for use when brlapi is not | 15 // Stub implementation of BrailleController for use when brlapi is not |
16 // enabled. | 16 // enabled. |
17 class BrailleControllerImpl : public BrailleController { | 17 class BrailleControllerImpl : public BrailleController { |
18 public: | 18 public: |
19 static BrailleControllerImpl* GetInstance(); | 19 static BrailleControllerImpl* GetInstance(); |
20 scoped_ptr<DisplayState> GetDisplayState() override; | 20 scoped_ptr<DisplayState> GetDisplayState() override; |
21 void WriteDots(const std::string& cells) override; | 21 void WriteDots(const std::vector<char>& cells) override; |
22 void AddObserver(BrailleObserver* observer) override; | 22 void AddObserver(BrailleObserver* observer) override; |
23 void RemoveObserver(BrailleObserver* observer) override; | 23 void RemoveObserver(BrailleObserver* observer) override; |
24 | 24 |
25 private: | 25 private: |
26 BrailleControllerImpl(); | 26 BrailleControllerImpl(); |
27 ~BrailleControllerImpl() override; | 27 ~BrailleControllerImpl() override; |
28 friend struct DefaultSingletonTraits<BrailleControllerImpl>; | 28 friend struct DefaultSingletonTraits<BrailleControllerImpl>; |
29 DISALLOW_COPY_AND_ASSIGN(BrailleControllerImpl); | 29 DISALLOW_COPY_AND_ASSIGN(BrailleControllerImpl); |
30 }; | 30 }; |
31 | 31 |
(...skipping 17 matching lines...) Expand all Loading... |
49 // static | 49 // static |
50 BrailleControllerImpl* BrailleControllerImpl::GetInstance() { | 50 BrailleControllerImpl* BrailleControllerImpl::GetInstance() { |
51 return Singleton<BrailleControllerImpl, | 51 return Singleton<BrailleControllerImpl, |
52 LeakySingletonTraits<BrailleControllerImpl> >::get(); | 52 LeakySingletonTraits<BrailleControllerImpl> >::get(); |
53 } | 53 } |
54 | 54 |
55 scoped_ptr<DisplayState> BrailleControllerImpl::GetDisplayState() { | 55 scoped_ptr<DisplayState> BrailleControllerImpl::GetDisplayState() { |
56 return scoped_ptr<DisplayState>(new DisplayState()).Pass(); | 56 return scoped_ptr<DisplayState>(new DisplayState()).Pass(); |
57 } | 57 } |
58 | 58 |
59 void BrailleControllerImpl::WriteDots(const std::string& cells) { | 59 void BrailleControllerImpl::WriteDots(const std::vector<char>& cells) { |
60 } | 60 } |
61 | 61 |
62 void BrailleControllerImpl::AddObserver(BrailleObserver* observer) { | 62 void BrailleControllerImpl::AddObserver(BrailleObserver* observer) { |
63 } | 63 } |
64 | 64 |
65 void BrailleControllerImpl::RemoveObserver(BrailleObserver* observer) { | 65 void BrailleControllerImpl::RemoveObserver(BrailleObserver* observer) { |
66 } | 66 } |
67 | 67 |
68 } // namespace braille_display_private | 68 } // namespace braille_display_private |
69 } // namespace api | 69 } // namespace api |
70 } // namespace extensions | 70 } // namespace extensions |
OLD | NEW |