| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef CHROME_BROWSER_BUG_REPORT_UTIL_H_ | 5 #ifndef CHROME_BROWSER_BUG_REPORT_UTIL_H_ |
| 6 #define CHROME_BROWSER_BUG_REPORT_UTIL_H_ | 6 #define CHROME_BROWSER_BUG_REPORT_UTIL_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 | 56 |
| 57 // This sets the address of the feedback server to be used by SendReport | 57 // This sets the address of the feedback server to be used by SendReport |
| 58 static void SetFeedbackServer(const std::string& server); | 58 static void SetFeedbackServer(const std::string& server); |
| 59 | 59 |
| 60 // Send the feedback report after the specified delay | 60 // Send the feedback report after the specified delay |
| 61 static void DispatchFeedback(Profile* profile, std::string* feedback_data, | 61 static void DispatchFeedback(Profile* profile, std::string* feedback_data, |
| 62 int64 delay); | 62 int64 delay); |
| 63 | 63 |
| 64 | 64 |
| 65 // Generates bug report data. | 65 // Generates bug report data. |
| 66 static void SendReport(Profile* profile, | 66 static void SendReport( |
| 67 int problem_type, | 67 Profile* profile |
| 68 const std::string& page_url_text, | 68 , int problem_type |
| 69 const std::string& description, | 69 , const std::string& page_url_text |
| 70 const char* png_data, | 70 , const std::string& description |
| 71 int png_data_length, | 71 , const char* png_data |
| 72 int png_width, | 72 , int png_data_length |
| 73 , int png_width |
| 74 , int png_height |
| 73 #if defined(OS_CHROMEOS) | 75 #if defined(OS_CHROMEOS) |
| 74 int png_height, | 76 , const std::string& user_email_text |
| 75 const std::string& user_email_text, | 77 , const char* zipped_logs_data |
| 76 const char* zipped_logs_data, | 78 , int zipped_logs_length |
| 77 int zipped_logs_length, | 79 , const chromeos::system::LogDictionaryType* const sys_info |
| 78 const chromeos::system::LogDictionaryType* const sys_info); | |
| 79 #else | |
| 80 int png_height); | |
| 81 #endif | 80 #endif |
| 82 | 81 ); |
| 83 // Redirects the user to Google's phishing reporting page. | 82 // Redirects the user to Google's phishing reporting page. |
| 84 static void ReportPhishing(TabContents* currentTab, | 83 static void ReportPhishing(TabContents* currentTab, |
| 85 const std::string& phishing_url); | 84 const std::string& phishing_url); |
| 85 // Maintains a single vector of bytes to store the last screenshot taken. |
| 86 static std::vector<unsigned char>* GetScreenshotPng(); |
| 87 static void ClearScreenshotPng(); |
| 88 static void SetScreenshotSize(const gfx::Rect& rect); |
| 89 static gfx::Rect& GetScreenshotSize(); |
| 86 | 90 |
| 87 class PostCleanup; | 91 class PostCleanup; |
| 88 | 92 |
| 89 private: | 93 private: |
| 90 // Add a key value pair to the feedback object | 94 // Add a key value pair to the feedback object |
| 91 static void AddFeedbackData( | 95 static void AddFeedbackData( |
| 92 userfeedback::ExternalExtensionSubmit* feedback_data, | 96 userfeedback::ExternalExtensionSubmit* feedback_data, |
| 93 const std::string& key, const std::string& value); | 97 const std::string& key, const std::string& value); |
| 94 | 98 |
| 95 // Send the feedback report | 99 // Send the feedback report |
| 96 static void SendFeedback(Profile* profile, std::string* feedback_data, | 100 static void SendFeedback(Profile* profile, std::string* feedback_data, |
| 97 int64 previous_delay); | 101 int64 previous_delay); |
| 98 | 102 |
| 99 #if defined(OS_CHROMEOS) | 103 #if defined(OS_CHROMEOS) |
| 100 static bool ValidFeedbackSize(const std::string& content); | 104 static bool ValidFeedbackSize(const std::string& content); |
| 101 #endif | 105 #endif |
| 102 | 106 |
| 103 static std::string feedback_server_; | 107 static std::string feedback_server_; |
| 104 | 108 |
| 105 DISALLOW_IMPLICIT_CONSTRUCTORS(BugReportUtil); | 109 DISALLOW_IMPLICIT_CONSTRUCTORS(BugReportUtil); |
| 106 }; | 110 }; |
| 107 | 111 |
| 108 #endif // CHROME_BROWSER_BUG_REPORT_UTIL_H_ | 112 #endif // CHROME_BROWSER_BUG_REPORT_UTIL_H_ |
| OLD | NEW |