summaryrefslogtreecommitdiffstats
path: root/chrome/browser/bug_report_util.cc
diff options
context:
space:
mode:
authorrkc@chromium.org <rkc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-31 07:19:11 +0000
committerrkc@chromium.org <rkc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-31 07:19:11 +0000
commitacaa37bbf4636288c74fe7515ba3893cc87cff4a (patch)
treeb065e45cc185bbee835f4051c29ad8a285fdeead /chrome/browser/bug_report_util.cc
parent4daee896cef92ccb21bddc4a952833986f0089e3 (diff)
downloadchromium_src-acaa37bbf4636288c74fe7515ba3893cc87cff4a.zip
chromium_src-acaa37bbf4636288c74fe7515ba3893cc87cff4a.tar.gz
chromium_src-acaa37bbf4636288c74fe7515ba3893cc87cff4a.tar.bz2
Fix saved screenshots for feedback.
Fixed the location where the saved screenshots are picked from. Also fixed the issue with saved screenshots blocking the UI. R=zelidrag@chromium.org,derat@chromium.org BUG=chromium-os:18227,chromium:73180 TEST=Tested with sending feedback using a saved screenshot. Review URL: http://codereview.chromium.org/7635017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@98934 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/bug_report_util.cc')
-rw-r--r--chrome/browser/bug_report_util.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/chrome/browser/bug_report_util.cc b/chrome/browser/bug_report_util.cc
index f00f85e..8c4340a 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;