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

Unified Diff: chrome/browser/bug_report_util.cc

Issue 7635017: Fix saved screenshots for feedback. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Mac fix 4 Created 9 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/bug_report_util.h ('k') | chrome/browser/ui/cocoa/browser_window_cocoa.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/bug_report_util.cc
diff --git a/chrome/browser/bug_report_util.cc b/chrome/browser/bug_report_util.cc
index f00f85ea891137defa97ab427bde2db932a67356..8c4340a8f48cec4120d7e269868ae4db6abe70de 100644
--- a/chrome/browser/bug_report_util.cc
+++ b/chrome/browser/bug_report_util.cc
@@ -253,8 +253,7 @@ void BugReportUtil::SendReport(
, int problem_type
, const std::string& page_url_text
, const std::string& description
- , const char* png_data
- , int png_data_length
+ , ScreenshotDataPtr image_data_ptr
, int png_width
, int png_height
#if defined(OS_CHROMEOS)
@@ -309,7 +308,7 @@ void BugReportUtil::SendReport(
AddFeedbackData(&feedback_data, std::string(kOsVersionTag), os_version);
// Include the page image if we have one.
- if (png_data) {
+ if (image_data_ptr.get() && image_data_ptr->size()) {
userfeedback::PostedScreenshot screenshot;
screenshot.set_mime_type(kPngMimeType);
// Set the dimensions of the screenshot
@@ -317,7 +316,10 @@ void BugReportUtil::SendReport(
dimensions.set_width(static_cast<float>(png_width));
dimensions.set_height(static_cast<float>(png_height));
*(screenshot.mutable_dimensions()) = dimensions;
- screenshot.set_binary_content(std::string(png_data, png_data_length));
+
+ int image_data_size = image_data_ptr->size();
+ char* image_data = reinterpret_cast<char*>(&(image_data_ptr->front()));
+ screenshot.set_binary_content(std::string(image_data, image_data_size));
// Set the screenshot object in feedback
*(feedback_data.mutable_screenshot()) = screenshot;
« no previous file with comments | « chrome/browser/bug_report_util.h ('k') | chrome/browser/ui/cocoa/browser_window_cocoa.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698