Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5676)

Unified Diff: chrome/browser/extensions/api/feedback_private/feedback_private_api.cc

Issue 2934303002: Provide a better way of injecting extra diagnostics in feedbacks (Closed)
Patch Set: pkasting's comments Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/api/feedback_private/feedback_private_api.cc
diff --git a/chrome/browser/extensions/api/feedback_private/feedback_private_api.cc b/chrome/browser/extensions/api/feedback_private/feedback_private_api.cc
index 47ce719d2fc9dfe409110f03d35d9d566d08bb7a..73c305ff16dfebb6391a9d297de11683637542f0 100644
--- a/chrome/browser/extensions/api/feedback_private/feedback_private_api.cc
+++ b/chrome/browser/extensions/api/feedback_private/feedback_private_api.cc
@@ -114,6 +114,7 @@ LogSourceAccessManager* FeedbackPrivateAPI::GetLogSourceAccessManager() const {
void FeedbackPrivateAPI::RequestFeedback(
const std::string& description_template,
const std::string& category_tag,
+ const std::string& extra_diagnostics,
const GURL& page_url) {
#if defined(OS_WIN)
// Show prompt for Software Removal Tool if the Reporter component has found
@@ -121,18 +122,20 @@ void FeedbackPrivateAPI::RequestFeedback(
if (base::FeatureList::IsEnabled(kSrtPromptOnFeedbackForm) &&
safe_browsing::ReporterFoundUws() &&
!safe_browsing::UserHasRunCleaner()) {
- RequestFeedbackForFlow(description_template, category_tag, page_url,
+ RequestFeedbackForFlow(description_template, category_tag,
+ extra_diagnostics, page_url,
FeedbackFlow::FEEDBACK_FLOW_SHOWSRTPROMPT);
return;
}
#endif
- RequestFeedbackForFlow(description_template, category_tag, page_url,
- FeedbackFlow::FEEDBACK_FLOW_REGULAR);
+ RequestFeedbackForFlow(description_template, category_tag, extra_diagnostics,
+ page_url, FeedbackFlow::FEEDBACK_FLOW_REGULAR);
}
void FeedbackPrivateAPI::RequestFeedbackForFlow(
const std::string& description_template,
const std::string& category_tag,
+ const std::string& extra_diagnostics,
const GURL& page_url,
api::feedback_private::FeedbackFlow flow) {
if (browser_context_ && EventRouter::Get(browser_context_)) {
@@ -140,10 +143,19 @@ void FeedbackPrivateAPI::RequestFeedbackForFlow(
info.description = description_template;
info.category_tag = base::MakeUnique<std::string>(category_tag);
info.page_url = base::MakeUnique<std::string>(page_url.spec());
- info.system_information.reset(new SystemInformationList);
+ info.system_information = base::MakeUnique<SystemInformationList>();
+
+ // Any extra diagnostics information should be added to the sys info.
+ if (!extra_diagnostics.empty()) {
+ SystemInformation extra_info;
+ extra_info.key = "EXTRA_DIAGNOSTICS";
+ extra_info.value = extra_diagnostics;
+ info.system_information->emplace_back(std::move(extra_info));
+ }
+
// The manager is only available if tracing is enabled.
if (TracingManager* manager = TracingManager::Get()) {
- info.trace_id.reset(new int(manager->RequestTrace()));
+ info.trace_id = base::MakeUnique<int>(manager->RequestTrace());
}
info.flow = flow;
#if defined(OS_MACOSX)
« no previous file with comments | « chrome/browser/extensions/api/feedback_private/feedback_private_api.h ('k') | chrome/browser/feedback/show_feedback_page.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698