| 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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 } | 115 } |
| 116 | 116 |
| 117 void FeedbackPrivateAPI::RequestFeedbackForFlow( | 117 void FeedbackPrivateAPI::RequestFeedbackForFlow( |
| 118 const std::string& description_template, | 118 const std::string& description_template, |
| 119 const std::string& category_tag, | 119 const std::string& category_tag, |
| 120 const GURL& page_url, | 120 const GURL& page_url, |
| 121 api::feedback_private::FeedbackFlow flow) { | 121 api::feedback_private::FeedbackFlow flow) { |
| 122 if (browser_context_ && EventRouter::Get(browser_context_)) { | 122 if (browser_context_ && EventRouter::Get(browser_context_)) { |
| 123 FeedbackInfo info; | 123 FeedbackInfo info; |
| 124 info.description = description_template; | 124 info.description = description_template; |
| 125 info.category_tag = base::WrapUnique(new std::string(category_tag)); | 125 info.category_tag = base::MakeUnique<std::string>(category_tag); |
| 126 info.page_url = base::WrapUnique(new std::string(page_url.spec())); | 126 info.page_url = base::MakeUnique<std::string>(page_url.spec()); |
| 127 info.system_information.reset(new SystemInformationList); | 127 info.system_information.reset(new SystemInformationList); |
| 128 // The manager is only available if tracing is enabled. | 128 // The manager is only available if tracing is enabled. |
| 129 if (TracingManager* manager = TracingManager::Get()) { | 129 if (TracingManager* manager = TracingManager::Get()) { |
| 130 info.trace_id.reset(new int(manager->RequestTrace())); | 130 info.trace_id.reset(new int(manager->RequestTrace())); |
| 131 } | 131 } |
| 132 info.flow = flow; | 132 info.flow = flow; |
| 133 | 133 |
| 134 std::unique_ptr<base::ListValue> args = | 134 std::unique_ptr<base::ListValue> args = |
| 135 feedback_private::OnFeedbackRequested::Create(info); | 135 feedback_private::OnFeedbackRequested::Create(info); |
| 136 | 136 |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 333 content::RecordAction( | 333 content::RecordAction( |
| 334 base::UserMetricsAction("Feedback.SrtPromptClosed")); | 334 base::UserMetricsAction("Feedback.SrtPromptClosed")); |
| 335 break; | 335 break; |
| 336 default: | 336 default: |
| 337 return RespondNow(Error("Invalid arugment.")); | 337 return RespondNow(Error("Invalid arugment.")); |
| 338 } | 338 } |
| 339 return RespondNow(NoArguments()); | 339 return RespondNow(NoArguments()); |
| 340 } | 340 } |
| 341 | 341 |
| 342 } // namespace extensions | 342 } // namespace extensions |
| OLD | NEW |