OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 EXTENSIONS_BROWSER_API_LOCK_SCREEN_DATA_LOCK_SCREEN_DATA_API_H_ | 5 #ifndef EXTENSIONS_BROWSER_API_LOCK_SCREEN_DATA_LOCK_SCREEN_DATA_API_H_ |
6 #define EXTENSIONS_BROWSER_API_LOCK_SCREEN_DATA_LOCK_SCREEN_DATA_API_H_ | 6 #define EXTENSIONS_BROWSER_API_LOCK_SCREEN_DATA_LOCK_SCREEN_DATA_API_H_ |
7 | 7 |
| 8 #include <memory> |
| 9 #include <vector> |
| 10 |
8 #include "base/macros.h" | 11 #include "base/macros.h" |
9 #include "extensions/browser/extension_function.h" | 12 #include "extensions/browser/extension_function.h" |
10 | 13 |
11 namespace extensions { | 14 namespace extensions { |
12 | 15 |
| 16 namespace lock_screen_data { |
| 17 enum class OperationResult; |
| 18 } |
| 19 |
13 class LockScreenDataCreateFunction : public UIThreadExtensionFunction { | 20 class LockScreenDataCreateFunction : public UIThreadExtensionFunction { |
14 public: | 21 public: |
15 LockScreenDataCreateFunction(); | 22 LockScreenDataCreateFunction(); |
16 | 23 |
17 private: | 24 private: |
18 ~LockScreenDataCreateFunction() override; | 25 ~LockScreenDataCreateFunction() override; |
19 | 26 |
20 ResponseAction Run() override; | 27 ResponseAction Run() override; |
21 | 28 |
22 DECLARE_EXTENSION_FUNCTION("lockScreen.data.create", LOCKSCREENDATA_CREATE); | 29 DECLARE_EXTENSION_FUNCTION("lockScreen.data.create", LOCKSCREENDATA_CREATE); |
(...skipping 15 matching lines...) Expand all Loading... |
38 | 45 |
39 class LockScreenDataGetContentFunction : public UIThreadExtensionFunction { | 46 class LockScreenDataGetContentFunction : public UIThreadExtensionFunction { |
40 public: | 47 public: |
41 LockScreenDataGetContentFunction(); | 48 LockScreenDataGetContentFunction(); |
42 | 49 |
43 private: | 50 private: |
44 ~LockScreenDataGetContentFunction() override; | 51 ~LockScreenDataGetContentFunction() override; |
45 | 52 |
46 ResponseAction Run() override; | 53 ResponseAction Run() override; |
47 | 54 |
| 55 void OnDone(lock_screen_data::OperationResult result, |
| 56 std::unique_ptr<std::vector<char>> data); |
| 57 |
48 DECLARE_EXTENSION_FUNCTION("lockScreen.data.getContent", | 58 DECLARE_EXTENSION_FUNCTION("lockScreen.data.getContent", |
49 LOCKSCREENDATA_GETCONTENT); | 59 LOCKSCREENDATA_GETCONTENT); |
50 DISALLOW_COPY_AND_ASSIGN(LockScreenDataGetContentFunction); | 60 DISALLOW_COPY_AND_ASSIGN(LockScreenDataGetContentFunction); |
51 }; | 61 }; |
52 | 62 |
53 class LockScreenDataSetContentFunction : public UIThreadExtensionFunction { | 63 class LockScreenDataSetContentFunction : public UIThreadExtensionFunction { |
54 public: | 64 public: |
55 LockScreenDataSetContentFunction(); | 65 LockScreenDataSetContentFunction(); |
56 | 66 |
57 private: | 67 private: |
58 ~LockScreenDataSetContentFunction() override; | 68 ~LockScreenDataSetContentFunction() override; |
59 | 69 |
60 ResponseAction Run() override; | 70 ResponseAction Run() override; |
61 | 71 |
| 72 void OnDone(lock_screen_data::OperationResult result); |
| 73 |
62 DECLARE_EXTENSION_FUNCTION("lockScreen.data.setContent", | 74 DECLARE_EXTENSION_FUNCTION("lockScreen.data.setContent", |
63 LOCKSCREENDATA_SETCONTENT); | 75 LOCKSCREENDATA_SETCONTENT); |
64 DISALLOW_COPY_AND_ASSIGN(LockScreenDataSetContentFunction); | 76 DISALLOW_COPY_AND_ASSIGN(LockScreenDataSetContentFunction); |
65 }; | 77 }; |
66 | 78 |
67 class LockScreenDataDeleteFunction : public UIThreadExtensionFunction { | 79 class LockScreenDataDeleteFunction : public UIThreadExtensionFunction { |
68 public: | 80 public: |
69 LockScreenDataDeleteFunction(); | 81 LockScreenDataDeleteFunction(); |
70 | 82 |
71 private: | 83 private: |
72 ~LockScreenDataDeleteFunction() override; | 84 ~LockScreenDataDeleteFunction() override; |
73 | 85 |
74 ResponseAction Run() override; | 86 ResponseAction Run() override; |
75 | 87 |
76 DECLARE_EXTENSION_FUNCTION("lockScreen.data.delete", LOCKSCREENDATA_DELETE); | 88 DECLARE_EXTENSION_FUNCTION("lockScreen.data.delete", LOCKSCREENDATA_DELETE); |
77 | 89 |
78 DISALLOW_COPY_AND_ASSIGN(LockScreenDataDeleteFunction); | 90 DISALLOW_COPY_AND_ASSIGN(LockScreenDataDeleteFunction); |
79 }; | 91 }; |
80 | 92 |
81 } // namespace extensions | 93 } // namespace extensions |
82 | 94 |
83 #endif // EXTENSIONS_BROWSER_API_LOCK_SCREEN_DATA_LOCK_SCREEN_DATA_API_H_ | 95 #endif // EXTENSIONS_BROWSER_API_LOCK_SCREEN_DATA_LOCK_SCREEN_DATA_API_H_ |
OLD | NEW |