| 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 #include "chrome/browser/extensions/api/feedback_private/feedback_private_api.h" | 5 #include "chrome/browser/extensions/api/feedback_private/feedback_private_api.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 if (feedback_info.screenshot_blob_uuid.get() && | 252 if (feedback_info.screenshot_blob_uuid.get() && |
| 253 !feedback_info.screenshot_blob_uuid->empty()) | 253 !feedback_info.screenshot_blob_uuid->empty()) |
| 254 screenshot_uuid = *feedback_info.screenshot_blob_uuid; | 254 screenshot_uuid = *feedback_info.screenshot_blob_uuid; |
| 255 | 255 |
| 256 // Populate feedback data. | 256 // Populate feedback data. |
| 257 scoped_refptr<FeedbackData> feedback_data(new FeedbackData()); | 257 scoped_refptr<FeedbackData> feedback_data(new FeedbackData()); |
| 258 feedback_data->set_context(GetProfile()); | 258 feedback_data->set_context(GetProfile()); |
| 259 feedback_data->set_description(feedback_info.description); | 259 feedback_data->set_description(feedback_info.description); |
| 260 | 260 |
| 261 if (feedback_info.category_tag.get()) | 261 if (feedback_info.category_tag.get()) |
| 262 feedback_data->set_category_tag(*feedback_info.category_tag.get()); | 262 feedback_data->set_category_tag(*feedback_info.category_tag); |
| 263 if (feedback_info.page_url.get()) | 263 if (feedback_info.page_url.get()) |
| 264 feedback_data->set_page_url(*feedback_info.page_url.get()); | 264 feedback_data->set_page_url(*feedback_info.page_url); |
| 265 if (feedback_info.email.get()) | 265 if (feedback_info.email.get()) |
| 266 feedback_data->set_user_email(*feedback_info.email.get()); | 266 feedback_data->set_user_email(*feedback_info.email); |
| 267 | 267 |
| 268 if (!attached_file_uuid.empty()) { | 268 if (!attached_file_uuid.empty()) { |
| 269 feedback_data->set_attached_filename( | 269 feedback_data->set_attached_filename( |
| 270 StripFakepath((*feedback_info.attached_file.get()).name)); | 270 StripFakepath((*feedback_info.attached_file).name)); |
| 271 feedback_data->set_attached_file_uuid(attached_file_uuid); | 271 feedback_data->set_attached_file_uuid(attached_file_uuid); |
| 272 } | 272 } |
| 273 | 273 |
| 274 if (!screenshot_uuid.empty()) | 274 if (!screenshot_uuid.empty()) |
| 275 feedback_data->set_screenshot_uuid(screenshot_uuid); | 275 feedback_data->set_screenshot_uuid(screenshot_uuid); |
| 276 | 276 |
| 277 if (feedback_info.trace_id.get()) { | 277 if (feedback_info.trace_id.get()) { |
| 278 feedback_data->set_trace_id(*feedback_info.trace_id.get()); | 278 feedback_data->set_trace_id(*feedback_info.trace_id); |
| 279 } | 279 } |
| 280 | 280 |
| 281 std::unique_ptr<FeedbackData::SystemLogsMap> sys_logs( | 281 std::unique_ptr<FeedbackData::SystemLogsMap> sys_logs( |
| 282 new FeedbackData::SystemLogsMap); | 282 new FeedbackData::SystemLogsMap); |
| 283 SystemInformationList* sys_info = feedback_info.system_information.get(); | 283 SystemInformationList* sys_info = feedback_info.system_information.get(); |
| 284 if (sys_info) { | 284 if (sys_info) { |
| 285 for (const SystemInformation& info : *sys_info) | 285 for (const SystemInformation& info : *sys_info) |
| 286 (*sys_logs)[info.key] = info.value; | 286 (*sys_logs)[info.key] = info.value; |
| 287 } | 287 } |
| 288 feedback_data->SetAndCompressSystemInfo(std::move(sys_logs)); | 288 feedback_data->SetAndCompressSystemInfo(std::move(sys_logs)); |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 content::RecordAction( | 335 content::RecordAction( |
| 336 base::UserMetricsAction("Feedback.SrtPromptClosed")); | 336 base::UserMetricsAction("Feedback.SrtPromptClosed")); |
| 337 break; | 337 break; |
| 338 default: | 338 default: |
| 339 return RespondNow(Error("Invalid arugment.")); | 339 return RespondNow(Error("Invalid arugment.")); |
| 340 } | 340 } |
| 341 return RespondNow(NoArguments()); | 341 return RespondNow(NoArguments()); |
| 342 } | 342 } |
| 343 | 343 |
| 344 } // namespace extensions | 344 } // namespace extensions |
| OLD | NEW |