OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2013 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. | |
4 | |
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_ | |
7 | |
8 #include "chrome/browser/extensions/api/api_function.h" | |
9 #include "chrome/browser/extensions/api/profile_keyed_api_factory.h" | |
10 #include "chrome/common/extensions/api/braille_display_private.h" | |
11 | |
12 namespace extensions { | |
13 | |
14 // Implementation of the chrome.brailleDisplayPrivate API. | |
15 class BrailleDisplayPrivateAPI : public ProfileKeyedAPI { | |
16 public: | |
17 explicit BrailleDisplayPrivateAPI(Profile* profile); | |
18 virtual ~BrailleDisplayPrivateAPI(); | |
19 | |
20 // ProfileKeyedService implementation. | |
21 virtual void Shutdown() OVERRIDE; | |
22 | |
23 // ProfileKeyedAPI implementation. | |
24 static ProfileKeyedAPIFactory<BrailleDisplayPrivateAPI>* GetFactoryInstance(); | |
25 | |
26 private: | |
27 friend class ProfileKeyedAPIFactory<BrailleDisplayPrivateAPI>; | |
28 | |
29 Profile* profile_; | |
30 | |
31 // ProfileKeyedAPI implementation. | |
32 static const char* service_name() { | |
33 return "BrailleDisplayPrivateAPI"; | |
34 } | |
35 static const bool kServiceIsNULLWhileTesting = true; | |
David Tseng
2013/09/03 23:57:17
Add a small comment to explain this.
| |
36 }; | |
37 | |
38 namespace api { | |
David Tseng
2013/09/03 23:57:17
nit: I think you want a blank line here.
| |
39 class BrailleDisplayPrivateGetDisplayStateFunction : public AsyncApiFunction { | |
40 DECLARE_EXTENSION_FUNCTION("brailleDisplayPrivate.getDisplayState", | |
41 BRAILLEDISPLAYPRIVATE_GETDISPLAYSTATE) | |
42 protected: | |
43 virtual ~BrailleDisplayPrivateGetDisplayStateFunction() {} | |
44 virtual bool Prepare() OVERRIDE; | |
45 virtual void Work() OVERRIDE; | |
46 virtual bool Respond() OVERRIDE; | |
47 }; | |
48 | |
49 class BrailleDisplayPrivateWriteDotsFunction : public AsyncApiFunction { | |
50 DECLARE_EXTENSION_FUNCTION("brailleDisplayPrivate.writeDots", | |
51 BRAILLEDISPLAYPRIVATE_WRITEDOTS); | |
52 public: | |
53 BrailleDisplayPrivateWriteDotsFunction(); | |
54 | |
55 protected: | |
56 virtual ~BrailleDisplayPrivateWriteDotsFunction(); | |
57 virtual bool Prepare() OVERRIDE; | |
58 virtual void Work() OVERRIDE; | |
59 virtual bool Respond() OVERRIDE; | |
60 | |
61 private: | |
62 scoped_ptr<braille_display_private::WriteDots::Params> params_; | |
63 }; | |
64 | |
65 } // namespace api | |
66 } // namespace extensions | |
67 | |
68 #endif // CHROME_BROWSER_EXTENSIONS_API_BRAILLE_DISPLAY_PRIVATE_BRAILLE_DISPLAY _PRIVATE_API_H_ | |
OLD | NEW |