Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(149)

Side by Side Diff: chrome/browser/extensions/api/feedback_private/feedback_private_api.cc

Issue 23458031: Fix feedback attach a file and system info code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/feedback/feedback_data.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 feedback_data->set_screenshot_url(GURL(screenshot_url)); 166 feedback_data->set_screenshot_url(GURL(screenshot_url));
167 167
168 scoped_ptr<FeedbackData::SystemLogsMap> sys_logs( 168 scoped_ptr<FeedbackData::SystemLogsMap> sys_logs(
169 new FeedbackData::SystemLogsMap); 169 new FeedbackData::SystemLogsMap);
170 SystemInformationList* sys_info = feedback_info.system_information.get(); 170 SystemInformationList* sys_info = feedback_info.system_information.get();
171 if (sys_info) { 171 if (sys_info) {
172 for (SystemInformationList::iterator it = sys_info->begin(); 172 for (SystemInformationList::iterator it = sys_info->begin();
173 it != sys_info->end(); ++it) 173 it != sys_info->end(); ++it)
174 (*sys_logs.get())[it->get()->key] = it->get()->value; 174 (*sys_logs.get())[it->get()->key] = it->get()->value;
175 } 175 }
176 feedback_data->set_sys_info(sys_logs.Pass()); 176 feedback_data->SetAndCompressSystemInfo(sys_logs.Pass());
177 177
178 FeedbackService* service = FeedbackPrivateAPI::GetFactoryInstance()-> 178 FeedbackService* service = FeedbackPrivateAPI::GetFactoryInstance()->
179 GetForProfile(profile())->GetService(); 179 GetForProfile(profile())->GetService();
180 DCHECK(service); 180 DCHECK(service);
181 service->SendFeedback(profile(), 181 service->SendFeedback(profile(),
182 feedback_data, base::Bind( 182 feedback_data, base::Bind(
183 &FeedbackPrivateSendFeedbackFunction::OnCompleted, 183 &FeedbackPrivateSendFeedbackFunction::OnCompleted,
184 this)); 184 this));
185 return true; 185 return true;
186 } 186 }
187 187
188 void FeedbackPrivateSendFeedbackFunction::OnCompleted( 188 void FeedbackPrivateSendFeedbackFunction::OnCompleted(
189 bool success) { 189 bool success) {
190 results_ = feedback_private::SendFeedback::Results::Create( 190 results_ = feedback_private::SendFeedback::Results::Create(
191 success ? feedback_private::STATUS_SUCCESS : 191 success ? feedback_private::STATUS_SUCCESS :
192 feedback_private::STATUS_DELAYED); 192 feedback_private::STATUS_DELAYED);
193 SendResponse(true); 193 SendResponse(true);
194 } 194 }
195 195
196 } // namespace extensions 196 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/feedback/feedback_data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698