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 "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/metrics/statistics_recorder.h" | 9 #include "base/metrics/statistics_recorder.h" |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 info.system_information.reset(new SystemInformationList); | 81 info.system_information.reset(new SystemInformationList); |
82 // The manager is only available if tracing is enabled. | 82 // The manager is only available if tracing is enabled. |
83 if (TracingManager* manager = TracingManager::Get()) { | 83 if (TracingManager* manager = TracingManager::Get()) { |
84 info.trace_id.reset(new int(manager->RequestTrace())); | 84 info.trace_id.reset(new int(manager->RequestTrace())); |
85 } | 85 } |
86 | 86 |
87 scoped_ptr<base::ListValue> args(new base::ListValue()); | 87 scoped_ptr<base::ListValue> args(new base::ListValue()); |
88 args->Append(info.ToValue().release()); | 88 args->Append(info.ToValue().release()); |
89 | 89 |
90 scoped_ptr<Event> event(new Event( | 90 scoped_ptr<Event> event(new Event( |
91 feedback_private::OnFeedbackRequested::kEventName, args.Pass())); | 91 events::UNKNOWN, feedback_private::OnFeedbackRequested::kEventName, |
| 92 args.Pass())); |
92 event->restrict_to_browser_context = browser_context_; | 93 event->restrict_to_browser_context = browser_context_; |
93 | 94 |
94 EventRouter::Get(browser_context_) | 95 EventRouter::Get(browser_context_) |
95 ->DispatchEventToExtension(kFeedbackExtensionId, event.Pass()); | 96 ->DispatchEventToExtension(kFeedbackExtensionId, event.Pass()); |
96 } | 97 } |
97 } | 98 } |
98 | 99 |
99 // static | 100 // static |
100 base::Closure* FeedbackPrivateGetStringsFunction::test_callback_ = NULL; | 101 base::Closure* FeedbackPrivateGetStringsFunction::test_callback_ = NULL; |
101 | 102 |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 | 236 |
236 void FeedbackPrivateSendFeedbackFunction::OnCompleted( | 237 void FeedbackPrivateSendFeedbackFunction::OnCompleted( |
237 bool success) { | 238 bool success) { |
238 results_ = feedback_private::SendFeedback::Results::Create( | 239 results_ = feedback_private::SendFeedback::Results::Create( |
239 success ? feedback_private::STATUS_SUCCESS : | 240 success ? feedback_private::STATUS_SUCCESS : |
240 feedback_private::STATUS_DELAYED); | 241 feedback_private::STATUS_DELAYED); |
241 SendResponse(true); | 242 SendResponse(true); |
242 } | 243 } |
243 | 244 |
244 } // namespace extensions | 245 } // namespace extensions |
OLD | NEW |