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