| 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" |
| 11 #include "ui/gfx/geometry/rect.h" | 11 #include "ui/gfx/geometry/rect.h" |
| 12 | 12 |
| 13 namespace extensions { | 13 namespace extensions { |
| 14 | 14 |
| 15 class FeedbackService; | 15 class FeedbackService; |
| 16 | 16 |
| 17 using extensions::api::feedback_private::SystemInformation; | |
| 18 | |
| 19 class FeedbackPrivateAPI : public BrowserContextKeyedAPI { | 17 class FeedbackPrivateAPI : public BrowserContextKeyedAPI { |
| 20 public: | 18 public: |
| 21 explicit FeedbackPrivateAPI(content::BrowserContext* context); | 19 explicit FeedbackPrivateAPI(content::BrowserContext* context); |
| 22 ~FeedbackPrivateAPI() override; | 20 ~FeedbackPrivateAPI() override; |
| 23 | 21 |
| 24 FeedbackService* GetService() const; | 22 FeedbackService* GetService() const; |
| 25 | 23 |
| 26 void RequestFeedback(const std::string& description_template, | 24 void RequestFeedback(const std::string& description_template, |
| 27 const std::string& category_tag, | 25 const std::string& category_tag, |
| 28 const GURL& page_url); | 26 const GURL& page_url); |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 public: | 84 public: |
| 87 DECLARE_EXTENSION_FUNCTION("feedbackPrivate.getSystemInformation", | 85 DECLARE_EXTENSION_FUNCTION("feedbackPrivate.getSystemInformation", |
| 88 FEEDBACKPRIVATE_GETSYSTEMINFORMATION); | 86 FEEDBACKPRIVATE_GETSYSTEMINFORMATION); |
| 89 | 87 |
| 90 protected: | 88 protected: |
| 91 ~FeedbackPrivateGetSystemInformationFunction() override {} | 89 ~FeedbackPrivateGetSystemInformationFunction() override {} |
| 92 bool RunAsync() override; | 90 bool RunAsync() override; |
| 93 | 91 |
| 94 private: | 92 private: |
| 95 void OnCompleted( | 93 void OnCompleted( |
| 96 const std::vector<linked_ptr<SystemInformation> >& sys_info); | 94 const std::vector<api::feedback_private::SystemInformation>& sys_info); |
| 97 }; | 95 }; |
| 98 | 96 |
| 99 class FeedbackPrivateSendFeedbackFunction | 97 class FeedbackPrivateSendFeedbackFunction |
| 100 : public ChromeAsyncExtensionFunction { | 98 : public ChromeAsyncExtensionFunction { |
| 101 public: | 99 public: |
| 102 DECLARE_EXTENSION_FUNCTION("feedbackPrivate.sendFeedback", | 100 DECLARE_EXTENSION_FUNCTION("feedbackPrivate.sendFeedback", |
| 103 FEEDBACKPRIVATE_SENDFEEDBACK); | 101 FEEDBACKPRIVATE_SENDFEEDBACK); |
| 104 | 102 |
| 105 protected: | 103 protected: |
| 106 ~FeedbackPrivateSendFeedbackFunction() override {} | 104 ~FeedbackPrivateSendFeedbackFunction() override {} |
| 107 bool RunAsync() override; | 105 bool RunAsync() override; |
| 108 | 106 |
| 109 private: | 107 private: |
| 110 void OnCompleted(bool success); | 108 void OnCompleted(bool success); |
| 111 }; | 109 }; |
| 112 | 110 |
| 113 } // namespace extensions | 111 } // namespace extensions |
| 114 | 112 |
| 115 #endif // CHROME_BROWSER_EXTENSIONS_API_FEEDBACK_PRIVATE_FEEDBACK_PRIVATE_API_H
_ | 113 #endif // CHROME_BROWSER_EXTENSIONS_API_FEEDBACK_PRIVATE_FEEDBACK_PRIVATE_API_H
_ |
| OLD | NEW |