| 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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 FeedbackInfo info; | 123 FeedbackInfo info; |
| 124 info.description = description_template; | 124 info.description = description_template; |
| 125 info.category_tag = base::MakeUnique<std::string>(category_tag); | 125 info.category_tag = base::MakeUnique<std::string>(category_tag); |
| 126 info.page_url = base::MakeUnique<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 #if defined(OS_MACOSX) |
| 134 info.use_system_window_frame = true; |
| 135 #else |
| 136 info.use_system_window_frame = false; |
| 137 #endif |
| 133 | 138 |
| 134 std::unique_ptr<base::ListValue> args = | 139 std::unique_ptr<base::ListValue> args = |
| 135 feedback_private::OnFeedbackRequested::Create(info); | 140 feedback_private::OnFeedbackRequested::Create(info); |
| 136 | 141 |
| 137 std::unique_ptr<Event> event(new Event( | 142 std::unique_ptr<Event> event(new Event( |
| 138 events::FEEDBACK_PRIVATE_ON_FEEDBACK_REQUESTED, | 143 events::FEEDBACK_PRIVATE_ON_FEEDBACK_REQUESTED, |
| 139 feedback_private::OnFeedbackRequested::kEventName, std::move(args))); | 144 feedback_private::OnFeedbackRequested::kEventName, std::move(args))); |
| 140 event->restrict_to_browser_context = browser_context_; | 145 event->restrict_to_browser_context = browser_context_; |
| 141 | 146 |
| 142 EventRouter::Get(browser_context_) | 147 EventRouter::Get(browser_context_) |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 333 content::RecordAction( | 338 content::RecordAction( |
| 334 base::UserMetricsAction("Feedback.SrtPromptClosed")); | 339 base::UserMetricsAction("Feedback.SrtPromptClosed")); |
| 335 break; | 340 break; |
| 336 default: | 341 default: |
| 337 return RespondNow(Error("Invalid arugment.")); | 342 return RespondNow(Error("Invalid arugment.")); |
| 338 } | 343 } |
| 339 return RespondNow(NoArguments()); | 344 return RespondNow(NoArguments()); |
| 340 } | 345 } |
| 341 | 346 |
| 342 } // namespace extensions | 347 } // namespace extensions |
| OLD | NEW |