Chromium Code Reviews| Index: chrome/browser/bug_report_util.cc |
| diff --git a/chrome/browser/bug_report_util.cc b/chrome/browser/bug_report_util.cc |
| index 948e46a413f3e34a05441334b68031f0f765e827..214a9d89c0cfd903563f2704c2c0ae6280342574 100644 |
| --- a/chrome/browser/bug_report_util.cc |
| +++ b/chrome/browser/bug_report_util.cc |
| @@ -49,9 +49,6 @@ static char const kProtBufMimeType[] = "application/x-protobuf"; |
| static char const kPngMimeType[] = "image/png"; |
| // Tags we use in product specific data |
| -static char const kPageTitleTag[] = "PAGE TITLE"; |
| -static char const kProblemTypeIdTag[] = "PROBLEM TYPE ID"; |
| -static char const kProblemTypeTag[] = "PROBLEM TYPE"; |
|
stevenjb
2011/08/03 01:55:20
Unused.
|
| static char const kChromeVersionTag[] = "CHROME VERSION"; |
| static char const kOsVersionTag[] = "OS VERSION"; |
| @@ -248,22 +245,22 @@ bool BugReportUtil::ValidFeedbackSize(const std::string& content) { |
| #endif |
| // static |
| -void BugReportUtil::SendReport(Profile* profile, |
| - int problem_type, |
| - const std::string& page_url_text, |
| - const std::string& description, |
| - const char* png_data, |
| - int png_data_length, |
| - int png_width, |
| +void BugReportUtil::SendReport( |
| + Profile* profile |
| + , int problem_type |
| + , const std::string& page_url_text |
| + , const std::string& description |
| + , const char* png_data |
| + , int png_data_length |
| + , int png_width |
| + , int png_height |
|
James Cook
2011/08/03 17:06:49
Missing end ) for non-ChromeOS builds.
|
| #if defined(OS_CHROMEOS) |
| - int png_height, |
| - const std::string& user_email_text, |
| - const char* zipped_logs_data, |
| - int zipped_logs_length, |
| - const chromeos::system::LogDictionaryType* const sys_info) { |
| -#else |
| - int png_height) { |
| + , const std::string& user_email_text |
| + , const char* zipped_logs_data |
| + , int zipped_logs_length |
| + , const chromeos::system::LogDictionaryType* const sys_info) |
| #endif |
| +{ |
| // Create google feedback protocol buffer objects |
| userfeedback::ExternalExtensionSubmit feedback_data; |
| // type id set to 0, unused field but needs to be initialized to 0 |
| @@ -327,11 +324,12 @@ void BugReportUtil::SendReport(Profile* profile, |
| if (sys_info) { |
| // Add the product specific data |
| for (chromeos::system::LogDictionaryType::const_iterator i = |
| - sys_info->begin(); i != sys_info->end(); ++i) |
| + sys_info->begin(); i != sys_info->end(); ++i) { |
|
James Cook
2011/08/03 17:06:49
Ah, this is much clearer with an explicit block.
|
| if (!CommandLine::ForCurrentProcess()->HasSwitch( |
| switches::kCompressSystemFeedback) || ValidFeedbackSize(i->second)) { |
| AddFeedbackData(&feedback_data, i->first, i->second); |
| } |
| + } |
| // If we have zipped logs, add them here |
| if (zipped_logs_data && CommandLine::ForCurrentProcess()->HasSwitch( |
| @@ -385,3 +383,25 @@ void BugReportUtil::ReportPhishing(TabContents* currentTab, |
| PageTransition::LINK); |
| } |
| #endif |
| + |
| +// static |
| +std::vector<unsigned char>* BugReportUtil::GetScreenshotPng() { |
| + static std::vector<unsigned char>* last_screenshot_png = NULL; |
|
James Cook
2011/08/03 17:06:49
Do we every free the memory occupied by the screen
stevenjb
2011/08/03 19:11:39
Yes, we call GetScreenshotPng()->clear() in BugRep
|
| + if (last_screenshot_png == NULL) |
| + last_screenshot_png = new std::vector<unsigned char>; |
| + return last_screenshot_png; |
| +} |
| + |
| +// static |
| +gfx::Rect& BugReportUtil::GetScreenshotSize() { |
| + static gfx::Rect* screen_size = NULL; |
| + if (screen_size == NULL) |
| + screen_size = new gfx::Rect(); |
| + return *screen_size; |
| +} |
| + |
| +// static |
| +void BugReportUtil::SetScreenshotSize(const gfx::Rect& rect) { |
| + gfx::Rect& screen_size = GetScreenshotSize(); |
| + screen_size = rect; |
| +} |