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_DISPLAY_PR
IVATE_API_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_BRAILLE_DISPLAY_PRIVATE_BRAILLE_DISPLAY_PR
IVATE_API_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_API_BRAILLE_DISPLAY_PRIVATE_BRAILLE_DISPLAY_PR
IVATE_API_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_BRAILLE_DISPLAY_PRIVATE_BRAILLE_DISPLAY_PR
IVATE_API_H_ |
7 | 7 |
8 #include "base/scoped_observer.h" | 8 #include "base/scoped_observer.h" |
9 #include "chrome/browser/extensions/api/braille_display_private/braille_controll
er.h" | 9 #include "chrome/browser/extensions/api/braille_display_private/braille_controll
er.h" |
10 #include "chrome/common/extensions/api/braille_display_private.h" | 10 #include "chrome/common/extensions/api/braille_display_private.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 | 23 |
24 // Implementation of the chrome.brailleDisplayPrivate API. | 24 // Implementation of the chrome.brailleDisplayPrivate API. |
25 class BrailleDisplayPrivateAPI : public BrowserContextKeyedAPI, | 25 class BrailleDisplayPrivateAPI : public BrowserContextKeyedAPI, |
26 api::braille_display_private::BrailleObserver, | 26 api::braille_display_private::BrailleObserver, |
27 EventRouter::Observer { | 27 EventRouter::Observer { |
28 public: | 28 public: |
29 explicit BrailleDisplayPrivateAPI(content::BrowserContext* context); | 29 explicit BrailleDisplayPrivateAPI(content::BrowserContext* context); |
30 virtual ~BrailleDisplayPrivateAPI(); | 30 virtual ~BrailleDisplayPrivateAPI(); |
31 | 31 |
32 // ProfileKeyedService implementation. | 32 // ProfileKeyedService implementation. |
33 virtual void Shutdown() OVERRIDE; | 33 virtual void Shutdown() override; |
34 | 34 |
35 // BrowserContextKeyedAPI implementation. | 35 // BrowserContextKeyedAPI implementation. |
36 static BrowserContextKeyedAPIFactory<BrailleDisplayPrivateAPI>* | 36 static BrowserContextKeyedAPIFactory<BrailleDisplayPrivateAPI>* |
37 GetFactoryInstance(); | 37 GetFactoryInstance(); |
38 | 38 |
39 // BrailleObserver implementation. | 39 // BrailleObserver implementation. |
40 virtual void OnBrailleDisplayStateChanged( | 40 virtual void OnBrailleDisplayStateChanged( |
41 const api::braille_display_private::DisplayState& display_state) OVERRIDE; | 41 const api::braille_display_private::DisplayState& display_state) override; |
42 virtual void OnBrailleKeyEvent( | 42 virtual void OnBrailleKeyEvent( |
43 const api::braille_display_private::KeyEvent& keyEvent) OVERRIDE; | 43 const api::braille_display_private::KeyEvent& keyEvent) override; |
44 | 44 |
45 // EventRouter::Observer implementation. | 45 // EventRouter::Observer implementation. |
46 virtual void OnListenerAdded(const EventListenerInfo& details) OVERRIDE; | 46 virtual void OnListenerAdded(const EventListenerInfo& details) override; |
47 virtual void OnListenerRemoved(const EventListenerInfo& details) OVERRIDE; | 47 virtual void OnListenerRemoved(const EventListenerInfo& details) override; |
48 | 48 |
49 | 49 |
50 private: | 50 private: |
51 friend class BrowserContextKeyedAPIFactory<BrailleDisplayPrivateAPI>; | 51 friend class BrowserContextKeyedAPIFactory<BrailleDisplayPrivateAPI>; |
52 friend class api::braille_display_private::BrailleDisplayPrivateAPIUserTest; | 52 friend class api::braille_display_private::BrailleDisplayPrivateAPIUserTest; |
53 | 53 |
54 class EventDelegate { | 54 class EventDelegate { |
55 public: | 55 public: |
56 virtual ~EventDelegate() {} | 56 virtual ~EventDelegate() {} |
57 virtual void BroadcastEvent(scoped_ptr<Event> event) = 0; | 57 virtual void BroadcastEvent(scoped_ptr<Event> event) = 0; |
(...skipping 21 matching lines...) Expand all Loading... |
79 static const bool kServiceIsNULLWhileTesting = true; | 79 static const bool kServiceIsNULLWhileTesting = true; |
80 }; | 80 }; |
81 | 81 |
82 namespace api { | 82 namespace api { |
83 | 83 |
84 class BrailleDisplayPrivateGetDisplayStateFunction : public AsyncApiFunction { | 84 class BrailleDisplayPrivateGetDisplayStateFunction : public AsyncApiFunction { |
85 DECLARE_EXTENSION_FUNCTION("brailleDisplayPrivate.getDisplayState", | 85 DECLARE_EXTENSION_FUNCTION("brailleDisplayPrivate.getDisplayState", |
86 BRAILLEDISPLAYPRIVATE_GETDISPLAYSTATE) | 86 BRAILLEDISPLAYPRIVATE_GETDISPLAYSTATE) |
87 protected: | 87 protected: |
88 virtual ~BrailleDisplayPrivateGetDisplayStateFunction() {} | 88 virtual ~BrailleDisplayPrivateGetDisplayStateFunction() {} |
89 virtual bool Prepare() OVERRIDE; | 89 virtual bool Prepare() override; |
90 virtual void Work() OVERRIDE; | 90 virtual void Work() override; |
91 virtual bool Respond() OVERRIDE; | 91 virtual bool Respond() override; |
92 }; | 92 }; |
93 | 93 |
94 class BrailleDisplayPrivateWriteDotsFunction : public AsyncApiFunction { | 94 class BrailleDisplayPrivateWriteDotsFunction : public AsyncApiFunction { |
95 DECLARE_EXTENSION_FUNCTION("brailleDisplayPrivate.writeDots", | 95 DECLARE_EXTENSION_FUNCTION("brailleDisplayPrivate.writeDots", |
96 BRAILLEDISPLAYPRIVATE_WRITEDOTS); | 96 BRAILLEDISPLAYPRIVATE_WRITEDOTS); |
97 public: | 97 public: |
98 BrailleDisplayPrivateWriteDotsFunction(); | 98 BrailleDisplayPrivateWriteDotsFunction(); |
99 | 99 |
100 protected: | 100 protected: |
101 virtual ~BrailleDisplayPrivateWriteDotsFunction(); | 101 virtual ~BrailleDisplayPrivateWriteDotsFunction(); |
102 virtual bool Prepare() OVERRIDE; | 102 virtual bool Prepare() override; |
103 virtual void Work() OVERRIDE; | 103 virtual void Work() override; |
104 virtual bool Respond() OVERRIDE; | 104 virtual bool Respond() override; |
105 | 105 |
106 private: | 106 private: |
107 scoped_ptr<braille_display_private::WriteDots::Params> params_; | 107 scoped_ptr<braille_display_private::WriteDots::Params> params_; |
108 }; | 108 }; |
109 | 109 |
110 } // namespace api | 110 } // namespace api |
111 } // namespace extensions | 111 } // namespace extensions |
112 | 112 |
113 #endif // CHROME_BROWSER_EXTENSIONS_API_BRAILLE_DISPLAY_PRIVATE_BRAILLE_DISPLAY
_PRIVATE_API_H_ | 113 #endif // CHROME_BROWSER_EXTENSIONS_API_BRAILLE_DISPLAY_PRIVATE_BRAILLE_DISPLAY
_PRIVATE_API_H_ |
OLD | NEW |