OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/chromeos/feedback_util.h" | 5 #include "chrome/browser/chromeos/feedback_util.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "chrome/browser/extensions/api/feedback_private/feedback_private_api.h" | 10 #include "chrome/browser/extensions/api/feedback_private/feedback_private_api.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 | 25 |
26 void OnGetSystemInformation(Profile* profile, | 26 void OnGetSystemInformation(Profile* profile, |
27 const std::string& description, | 27 const std::string& description, |
28 const SendSysLogFeedbackCallback& callback, | 28 const SendSysLogFeedbackCallback& callback, |
29 const extensions::SystemInformationList& sys_info) { | 29 const extensions::SystemInformationList& sys_info) { |
30 scoped_refptr<FeedbackData> feedback_data(new FeedbackData()); | 30 scoped_refptr<FeedbackData> feedback_data(new FeedbackData()); |
31 | 31 |
32 feedback_data->set_context(profile); | 32 feedback_data->set_context(profile); |
33 feedback_data->set_description(description); | 33 feedback_data->set_description(description); |
34 | 34 |
35 scoped_ptr<FeedbackData::SystemLogsMap> sys_logs( | 35 std::unique_ptr<FeedbackData::SystemLogsMap> sys_logs( |
36 new FeedbackData::SystemLogsMap); | 36 new FeedbackData::SystemLogsMap); |
37 for (const extensions::api::feedback_private::SystemInformation& info : | 37 for (const extensions::api::feedback_private::SystemInformation& info : |
38 sys_info) { | 38 sys_info) { |
39 (*sys_logs.get())[info.key] = info.value; | 39 (*sys_logs.get())[info.key] = info.value; |
40 } | 40 } |
41 feedback_data->SetAndCompressSystemInfo(std::move(sys_logs)); | 41 feedback_data->SetAndCompressSystemInfo(std::move(sys_logs)); |
42 | 42 |
43 GetFeedbackService(profile)->SendFeedback(profile, feedback_data, callback); | 43 GetFeedbackService(profile)->SendFeedback(profile, feedback_data, callback); |
44 } | 44 } |
45 | 45 |
46 } // namespace | 46 } // namespace |
47 | 47 |
48 void SendSysLogFeedback(Profile* profile, | 48 void SendSysLogFeedback(Profile* profile, |
49 const std::string& description, | 49 const std::string& description, |
50 const SendSysLogFeedbackCallback& callback) { | 50 const SendSysLogFeedbackCallback& callback) { |
51 GetFeedbackService(profile)->GetSystemInformation( | 51 GetFeedbackService(profile)->GetSystemInformation( |
52 base::Bind(&OnGetSystemInformation, profile, description, callback)); | 52 base::Bind(&OnGetSystemInformation, profile, description, callback)); |
53 } | 53 } |
54 | 54 |
55 } // namespace feedback_util | 55 } // namespace feedback_util |
OLD | NEW |