Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(216)

Side by Side Diff: chrome/browser/extensions/api/braille_private/braille_private_api.h

Issue 13355002: Implement chrome.brailleDisplayPrivate API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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_PRIVATE_BRAILLE_PRIVATE_API_H_
6 #define CHROME_BROWSER_EXTENSIONS_API_BRAILLE_PRIVATE_BRAILLE_PRIVATE_API_H_
7
8 #include "chrome/browser/extensions/api/api_function.h"
9 #include "chrome/browser/extensions/api/braille_private/braille_controller.h"
10 #include "chrome/browser/extensions/api/profile_keyed_api_factory.h"
11 #include "chrome/common/extensions/api/braille_private.h"
12
13 namespace extensions {
14
15 class BraillePrivateAPI : public ProfileKeyedAPI,
16 api::braille_private::BrailleController::Observer {
17 public:
18 explicit BraillePrivateAPI(Profile* profile);
19 virtual ~BraillePrivateAPI();
20
21 // ProfileKeyedService implementation.
22 virtual void Shutdown() OVERRIDE;
23
24 // ProfileKeyedAPI implementation.
25 static ProfileKeyedAPIFactory<BraillePrivateAPI>* GetFactoryInstance();
26
27 // BrailleController::Observer implementation.
28 virtual void OnKeyEvent(scoped_ptr<base::DictionaryValue> event);
29
30
31 private:
32 friend class ProfileKeyedAPIFactory<BraillePrivateAPI>;
33
34 Profile* profile_;
35
36 // ProfileKeyedAPI implementation.
37 static const char* service_name() {
38 return "BraillePrivateAPI";
39 }
40 static const bool kServiceIsNULLWhileTesting = true;
41
42 };
43
44 namespace api {
45 class BraillePrivateGetDisplayStateFunction : public AsyncApiFunction {
46 DECLARE_EXTENSION_FUNCTION("braillePrivate.getDisplayState",
47 BRAILLEPRIVATE_WRITETEXT)
48 protected:
49 virtual bool Prepare() OVERRIDE;
50 virtual void Work() OVERRIDE;
51 virtual bool Respond() OVERRIDE;
52 };
53
54 class BraillePrivateWriteTextFunction : public AsyncApiFunction {
55 DECLARE_EXTENSION_FUNCTION("braillePrivate.writeText",
56 BRAILLEPRIVATE_WRITETEXT)
57 protected:
58 virtual bool Prepare() OVERRIDE;
59 virtual void Work() OVERRIDE;
60 virtual bool Respond() OVERRIDE;
61 private:
62 scoped_ptr<braille_private::WriteText::Params> params_;
63 };
64
65 class BraillePrivateWriteDotsFunction : public AsyncApiFunction {
66 DECLARE_EXTENSION_FUNCTION("braillePrivate.writeDots",
67 BRAILLEPRIVATE_WRITEDOTS)
68 protected:
69 virtual bool Prepare() OVERRIDE;
70 virtual void Work() OVERRIDE;
71 virtual bool Respond() OVERRIDE;
72 };
73 } // namespace api
74 } // namespace extensions
75 #endif // CHROME_BROWSER_EXTENSIONS_API_BRAILLE_PRIVATE_BRAILLE_PRIVATE_API_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698