| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 COMPONENTS_FEEDBACK_FEEDBACK_COMMON_H_ | 5 #ifndef COMPONENTS_FEEDBACK_FEEDBACK_COMMON_H_ |
| 6 #define COMPONENTS_FEEDBACK_FEEDBACK_COMMON_H_ | 6 #define COMPONENTS_FEEDBACK_FEEDBACK_COMMON_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 void set_image(std::unique_ptr<std::string> image) { | 93 void set_image(std::unique_ptr<std::string> image) { |
| 94 image_ = std::move(image); | 94 image_ = std::move(image); |
| 95 } | 95 } |
| 96 void set_product_id(int32_t product_id) { product_id_ = product_id; } | 96 void set_product_id(int32_t product_id) { product_id_ = product_id; } |
| 97 void set_user_agent(const std::string& user_agent) { | 97 void set_user_agent(const std::string& user_agent) { |
| 98 user_agent_ = user_agent; | 98 user_agent_ = user_agent; |
| 99 } | 99 } |
| 100 void set_locale(const std::string& locale) { locale_ = locale; } | 100 void set_locale(const std::string& locale) { locale_ = locale; } |
| 101 | 101 |
| 102 protected: | 102 protected: |
| 103 virtual ~FeedbackCommon(); |
| 104 |
| 105 private: |
| 103 friend class base::RefCountedThreadSafe<FeedbackCommon>; | 106 friend class base::RefCountedThreadSafe<FeedbackCommon>; |
| 104 friend class FeedbackCommonTest; | 107 friend class FeedbackCommonTest; |
| 105 | 108 |
| 106 virtual ~FeedbackCommon(); | 109 // Returns true if a product ID was set in the feedback report. |
| 110 bool HasProductId() const { return product_id_ != -1; } |
| 107 | 111 |
| 108 private: | |
| 109 std::string category_tag_; | 112 std::string category_tag_; |
| 110 std::string page_url_; | 113 std::string page_url_; |
| 111 std::string description_; | 114 std::string description_; |
| 112 std::string user_email_; | 115 std::string user_email_; |
| 113 int32_t product_id_; | 116 int32_t product_id_; |
| 114 std::string user_agent_; | 117 std::string user_agent_; |
| 115 std::string locale_; | 118 std::string locale_; |
| 116 | 119 |
| 117 std::unique_ptr<std::string> image_; | 120 std::unique_ptr<std::string> image_; |
| 118 | 121 |
| 119 // It is possible that multiple attachment add calls are running in | 122 // It is possible that multiple attachment add calls are running in |
| 120 // parallel, so synchronize access. | 123 // parallel, so synchronize access. |
| 121 base::Lock attachments_lock_; | 124 base::Lock attachments_lock_; |
| 122 ScopedVector<AttachedFile> attachments_; | 125 ScopedVector<AttachedFile> attachments_; |
| 123 | 126 |
| 124 std::unique_ptr<SystemLogsMap> logs_; | 127 std::unique_ptr<SystemLogsMap> logs_; |
| 125 }; | 128 }; |
| 126 | 129 |
| 127 #endif // COMPONENTS_FEEDBACK_FEEDBACK_COMMON_H_ | 130 #endif // COMPONENTS_FEEDBACK_FEEDBACK_COMMON_H_ |
| OLD | NEW |