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_FEEDBACK_PRIVATE_FEEDBACK_PRIVATE_API_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_FEEDBACK_PRIVATE_FEEDBACK_PRIVATE_API_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_API_FEEDBACK_PRIVATE_FEEDBACK_PRIVATE_API_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_FEEDBACK_PRIVATE_FEEDBACK_PRIVATE_API_H_ |
7 | 7 |
8 #include "chrome/browser/extensions/chrome_extension_function.h" | 8 #include "chrome/browser/extensions/chrome_extension_function.h" |
9 #include "chrome/common/extensions/api/feedback_private.h" | 9 #include "chrome/common/extensions/api/feedback_private.h" |
10 #include "extensions/browser/browser_context_keyed_api_factory.h" | 10 #include "extensions/browser/browser_context_keyed_api_factory.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 return "FeedbackPrivateAPI"; | 43 return "FeedbackPrivateAPI"; |
44 } | 44 } |
45 | 45 |
46 static const bool kServiceHasOwnInstanceInIncognito = true; | 46 static const bool kServiceHasOwnInstanceInIncognito = true; |
47 | 47 |
48 content::BrowserContext* const browser_context_; | 48 content::BrowserContext* const browser_context_; |
49 FeedbackService* service_; | 49 FeedbackService* service_; |
50 }; | 50 }; |
51 | 51 |
52 // Feedback strings. | 52 // Feedback strings. |
53 class FeedbackPrivateGetStringsFunction : public ChromeSyncExtensionFunction { | 53 class FeedbackPrivateGetStringsFunction : public UIThreadExtensionFunction { |
54 public: | 54 public: |
55 DECLARE_EXTENSION_FUNCTION("feedbackPrivate.getStrings", | 55 DECLARE_EXTENSION_FUNCTION("feedbackPrivate.getStrings", |
56 FEEDBACKPRIVATE_GETSTRINGS) | 56 FEEDBACKPRIVATE_GETSTRINGS) |
57 | 57 |
58 // Invoke this callback when this function is called - used for testing. | 58 // Invoke this callback when this function is called - used for testing. |
59 static void set_test_callback(base::Closure* const callback) { | 59 static void set_test_callback(base::Closure* const callback) { |
60 test_callback_ = callback; | 60 test_callback_ = callback; |
61 } | 61 } |
62 | 62 |
63 protected: | 63 protected: |
64 ~FeedbackPrivateGetStringsFunction() override {} | 64 ~FeedbackPrivateGetStringsFunction() override {} |
65 | 65 |
66 // SyncExtensionFunction overrides. | 66 // ExtensionFunction: |
67 bool RunSync() override; | 67 ResponseAction Run() override; |
68 | 68 |
69 private: | 69 private: |
70 static base::Closure* test_callback_; | 70 static base::Closure* test_callback_; |
71 }; | 71 }; |
72 | 72 |
73 class FeedbackPrivateGetUserEmailFunction : public ChromeSyncExtensionFunction { | 73 class FeedbackPrivateGetUserEmailFunction : public UIThreadExtensionFunction { |
74 public: | 74 public: |
75 DECLARE_EXTENSION_FUNCTION("feedbackPrivate.getUserEmail", | 75 DECLARE_EXTENSION_FUNCTION("feedbackPrivate.getUserEmail", |
76 FEEDBACKPRIVATE_GETUSEREMAIL); | 76 FEEDBACKPRIVATE_GETUSEREMAIL); |
77 | 77 |
78 protected: | 78 protected: |
79 ~FeedbackPrivateGetUserEmailFunction() override {} | 79 ~FeedbackPrivateGetUserEmailFunction() override {} |
80 bool RunSync() override; | 80 ResponseAction Run() override; |
81 }; | 81 }; |
82 | 82 |
83 class FeedbackPrivateGetSystemInformationFunction | 83 class FeedbackPrivateGetSystemInformationFunction |
84 : public ChromeAsyncExtensionFunction { | 84 : public ChromeAsyncExtensionFunction { |
85 public: | 85 public: |
86 DECLARE_EXTENSION_FUNCTION("feedbackPrivate.getSystemInformation", | 86 DECLARE_EXTENSION_FUNCTION("feedbackPrivate.getSystemInformation", |
87 FEEDBACKPRIVATE_GETSYSTEMINFORMATION); | 87 FEEDBACKPRIVATE_GETSYSTEMINFORMATION); |
88 | 88 |
89 protected: | 89 protected: |
90 ~FeedbackPrivateGetSystemInformationFunction() override {} | 90 ~FeedbackPrivateGetSystemInformationFunction() override {} |
(...skipping 25 matching lines...) Expand all Loading... |
116 FEEDBACKPRIVATE_LOGSRTPROMPTRESULT); | 116 FEEDBACKPRIVATE_LOGSRTPROMPTRESULT); |
117 | 117 |
118 protected: | 118 protected: |
119 ~FeedbackPrivateLogSrtPromptResultFunction() override {} | 119 ~FeedbackPrivateLogSrtPromptResultFunction() override {} |
120 AsyncExtensionFunction::ResponseAction Run() override; | 120 AsyncExtensionFunction::ResponseAction Run() override; |
121 }; | 121 }; |
122 | 122 |
123 } // namespace extensions | 123 } // namespace extensions |
124 | 124 |
125 #endif // CHROME_BROWSER_EXTENSIONS_API_FEEDBACK_PRIVATE_FEEDBACK_PRIVATE_API_H
_ | 125 #endif // CHROME_BROWSER_EXTENSIONS_API_FEEDBACK_PRIVATE_FEEDBACK_PRIVATE_API_H
_ |
OLD | NEW |