| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 | 54 |
| 55 // Invoke this callback when this function is called - used for testing. | 55 // Invoke this callback when this function is called - used for testing. |
| 56 static void set_test_callback(base::Closure* const callback) { | 56 static void set_test_callback(base::Closure* const callback) { |
| 57 test_callback_ = callback; | 57 test_callback_ = callback; |
| 58 } | 58 } |
| 59 | 59 |
| 60 protected: | 60 protected: |
| 61 virtual ~FeedbackPrivateGetStringsFunction() {} | 61 virtual ~FeedbackPrivateGetStringsFunction() {} |
| 62 | 62 |
| 63 // SyncExtensionFunction overrides. | 63 // SyncExtensionFunction overrides. |
| 64 virtual bool RunImpl() OVERRIDE; | 64 virtual bool RunSync() OVERRIDE; |
| 65 | 65 |
| 66 private: | 66 private: |
| 67 static base::Closure* test_callback_; | 67 static base::Closure* test_callback_; |
| 68 }; | 68 }; |
| 69 | 69 |
| 70 class FeedbackPrivateGetUserEmailFunction : public ChromeSyncExtensionFunction { | 70 class FeedbackPrivateGetUserEmailFunction : public ChromeSyncExtensionFunction { |
| 71 public: | 71 public: |
| 72 DECLARE_EXTENSION_FUNCTION("feedbackPrivate.getUserEmail", | 72 DECLARE_EXTENSION_FUNCTION("feedbackPrivate.getUserEmail", |
| 73 FEEDBACKPRIVATE_GETUSEREMAIL); | 73 FEEDBACKPRIVATE_GETUSEREMAIL); |
| 74 | 74 |
| 75 protected: | 75 protected: |
| 76 virtual ~FeedbackPrivateGetUserEmailFunction() {} | 76 virtual ~FeedbackPrivateGetUserEmailFunction() {} |
| 77 virtual bool RunImpl() OVERRIDE; | 77 virtual bool RunSync() OVERRIDE; |
| 78 }; | 78 }; |
| 79 | 79 |
| 80 class FeedbackPrivateGetSystemInformationFunction | 80 class FeedbackPrivateGetSystemInformationFunction |
| 81 : public ChromeAsyncExtensionFunction { | 81 : public ChromeAsyncExtensionFunction { |
| 82 public: | 82 public: |
| 83 DECLARE_EXTENSION_FUNCTION("feedbackPrivate.getSystemInformation", | 83 DECLARE_EXTENSION_FUNCTION("feedbackPrivate.getSystemInformation", |
| 84 FEEDBACKPRIVATE_GETSYSTEMINFORMATION); | 84 FEEDBACKPRIVATE_GETSYSTEMINFORMATION); |
| 85 | 85 |
| 86 protected: | 86 protected: |
| 87 virtual ~FeedbackPrivateGetSystemInformationFunction() {} | 87 virtual ~FeedbackPrivateGetSystemInformationFunction() {} |
| 88 virtual bool RunImpl() OVERRIDE; | 88 virtual bool RunSync() OVERRIDE; |
| 89 | 89 |
| 90 private: | 90 private: |
| 91 void OnCompleted( | 91 void OnCompleted( |
| 92 const std::vector<linked_ptr<SystemInformation> >& sys_info); | 92 const std::vector<linked_ptr<SystemInformation> >& sys_info); |
| 93 }; | 93 }; |
| 94 | 94 |
| 95 class FeedbackPrivateSendFeedbackFunction | 95 class FeedbackPrivateSendFeedbackFunction |
| 96 : public ChromeAsyncExtensionFunction { | 96 : public ChromeAsyncExtensionFunction { |
| 97 public: | 97 public: |
| 98 DECLARE_EXTENSION_FUNCTION("feedbackPrivate.sendFeedback", | 98 DECLARE_EXTENSION_FUNCTION("feedbackPrivate.sendFeedback", |
| 99 FEEDBACKPRIVATE_SENDFEEDBACK); | 99 FEEDBACKPRIVATE_SENDFEEDBACK); |
| 100 | 100 |
| 101 protected: | 101 protected: |
| 102 virtual ~FeedbackPrivateSendFeedbackFunction() {} | 102 virtual ~FeedbackPrivateSendFeedbackFunction() {} |
| 103 virtual bool RunImpl() OVERRIDE; | 103 virtual bool RunSync() OVERRIDE; |
| 104 | 104 |
| 105 private: | 105 private: |
| 106 void OnCompleted(bool success); | 106 void OnCompleted(bool success); |
| 107 }; | 107 }; |
| 108 | 108 |
| 109 } // namespace extensions | 109 } // namespace extensions |
| 110 | 110 |
| 111 #endif // CHROME_BROWSER_EXTENSIONS_API_FEEDBACK_PRIVATE_FEEDBACK_PRIVATE_API_H
_ | 111 #endif // CHROME_BROWSER_EXTENSIONS_API_FEEDBACK_PRIVATE_FEEDBACK_PRIVATE_API_H
_ |
| OLD | NEW |