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

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: Style fix. 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
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..146f42694c6ecff86c476021c9bd527efae5a317 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,15 +308,18 @@ 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()) {
userfeedback::PostedScreenshot screenshot;
screenshot.set_mime_type(kPngMimeType);
// Set the dimensions of the screenshot
userfeedback::Dimensions dimensions;
dimensions.set_width(static_cast<float>(png_width));
dimensions.set_height(static_cast<float>(png_height));
+ int image_data_size = image_data_ptr->size();
+ char* image_data = image_data_size ?
+ reinterpret_cast<char*>(&(image_data_ptr->front())) : NULL;
*(screenshot.mutable_dimensions()) = dimensions;
- screenshot.set_binary_content(std::string(png_data, png_data_length));
+ screenshot.set_binary_content(std::string(image_data, image_data_size));
// Set the screenshot object in feedback
*(feedback_data.mutable_screenshot()) = screenshot;

Powered by Google App Engine
This is Rietveld 408576698