| 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_service.h" | 5 #include "chrome/browser/extensions/api/feedback_private/feedback_service.h" |
| 6 | 6 |
| 7 #include <utility> |
| 8 |
| 7 #include "base/callback.h" | 9 #include "base/callback.h" |
| 8 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| 9 #include "base/strings/string_number_conversions.h" | 11 #include "base/strings/string_number_conversions.h" |
| 10 #include "chrome/browser/browser_process.h" | 12 #include "chrome/browser/browser_process.h" |
| 11 #include "chrome/browser/profiles/profile.h" | 13 #include "chrome/browser/profiles/profile.h" |
| 12 #include "chrome/common/chrome_content_client.h" | 14 #include "chrome/common/chrome_content_client.h" |
| 13 #include "content/public/browser/browser_thread.h" | 15 #include "content/public/browser/browser_thread.h" |
| 14 | 16 |
| 15 using content::BrowserThread; | 17 using content::BrowserThread; |
| 16 using feedback::FeedbackData; | 18 using feedback::FeedbackData; |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 screenshot_reader->Start(); | 68 screenshot_reader->Start(); |
| 67 } | 69 } |
| 68 | 70 |
| 69 CompleteSendFeedback(); | 71 CompleteSendFeedback(); |
| 70 } | 72 } |
| 71 | 73 |
| 72 void FeedbackService::AttachedFileCallback(scoped_ptr<std::string> data, | 74 void FeedbackService::AttachedFileCallback(scoped_ptr<std::string> data, |
| 73 int64_t /* total_blob_length */) { | 75 int64_t /* total_blob_length */) { |
| 74 feedback_data_->set_attached_file_uuid(std::string()); | 76 feedback_data_->set_attached_file_uuid(std::string()); |
| 75 if (data) | 77 if (data) |
| 76 feedback_data_->AttachAndCompressFileData(data.Pass()); | 78 feedback_data_->AttachAndCompressFileData(std::move(data)); |
| 77 | 79 |
| 78 CompleteSendFeedback(); | 80 CompleteSendFeedback(); |
| 79 } | 81 } |
| 80 | 82 |
| 81 void FeedbackService::ScreenshotCallback(scoped_ptr<std::string> data, | 83 void FeedbackService::ScreenshotCallback(scoped_ptr<std::string> data, |
| 82 int64_t /* total_blob_length */) { | 84 int64_t /* total_blob_length */) { |
| 83 feedback_data_->set_screenshot_uuid(std::string()); | 85 feedback_data_->set_screenshot_uuid(std::string()); |
| 84 if (data) | 86 if (data) |
| 85 feedback_data_->set_image(data.Pass()); | 87 feedback_data_->set_image(std::move(data)); |
| 86 | 88 |
| 87 CompleteSendFeedback(); | 89 CompleteSendFeedback(); |
| 88 } | 90 } |
| 89 | 91 |
| 90 void FeedbackService::GetSystemInformation( | 92 void FeedbackService::GetSystemInformation( |
| 91 const GetSystemInformationCallback& callback) { | 93 const GetSystemInformationCallback& callback) { |
| 92 system_information_callback_ = callback; | 94 system_information_callback_ = callback; |
| 93 | 95 |
| 94 system_logs::ScrubbedSystemLogsFetcher* fetcher = | 96 system_logs::ScrubbedSystemLogsFetcher* fetcher = |
| 95 new system_logs::ScrubbedSystemLogsFetcher(); | 97 new system_logs::ScrubbedSystemLogsFetcher(); |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 // Signal the feedback object that the data from the feedback page has been | 130 // Signal the feedback object that the data from the feedback page has been |
| 129 // filled - the object will manage sending of the actual report. | 131 // filled - the object will manage sending of the actual report. |
| 130 feedback_data_->OnFeedbackPageDataComplete(); | 132 feedback_data_->OnFeedbackPageDataComplete(); |
| 131 // TODO(rkc): Change this once we have FeedbackData/Util refactored to | 133 // TODO(rkc): Change this once we have FeedbackData/Util refactored to |
| 132 // report the status of the report being sent. | 134 // report the status of the report being sent. |
| 133 send_feedback_callback_.Run(true); | 135 send_feedback_callback_.Run(true); |
| 134 } | 136 } |
| 135 } | 137 } |
| 136 | 138 |
| 137 } // namespace extensions | 139 } // namespace extensions |
| OLD | NEW |