| 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_DATA_H_ | 5 #ifndef CHROME_BROWSER_BUG_REPORT_DATA_H_ |
| 6 #define CHROME_BROWSER_BUG_REPORT_DATA_H_ | 6 #define CHROME_BROWSER_BUG_REPORT_DATA_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/utf_string_conversions.h" | 11 #include "base/utf_string_conversions.h" |
| 12 #include "chrome/browser/ui/webui/screenshot_source.h" |
| 12 | 13 |
| 13 #if defined(OS_CHROMEOS) | 14 #if defined(OS_CHROMEOS) |
| 14 #include "chrome/browser/chromeos/system/syslogs_provider.h" | 15 #include "chrome/browser/chromeos/system/syslogs_provider.h" |
| 15 #endif | 16 #endif |
| 16 | 17 |
| 17 class Profile; | 18 class Profile; |
| 18 | 19 |
| 19 class BugReportData { | 20 class BugReportData { |
| 20 public: | 21 public: |
| 21 BugReportData(); | 22 BugReportData(); |
| 22 ~BugReportData(); | 23 ~BugReportData(); |
| 23 | 24 |
| 24 void SendReport(); | 25 void SendReport(); |
| 25 | 26 |
| 26 void UpdateData(Profile* profile, | 27 void UpdateData(Profile* profile, |
| 27 const std::string& target_tab_url, | 28 const std::string& target_tab_url, |
| 28 const int problem_type, | 29 const int problem_type, |
| 29 const std::string& page_url, | 30 const std::string& page_url, |
| 30 const std::string& description, | 31 const std::string& description, |
| 31 const std::vector<unsigned char>& image | 32 ScreenshotDataPtr image |
| 32 #if defined(OS_CHROMEOS) | 33 #if defined(OS_CHROMEOS) |
| 33 , const std::string& user_email | 34 , const std::string& user_email |
| 34 , const bool send_sys_info | 35 , const bool send_sys_info |
| 35 , const bool sent_report | 36 , const bool sent_report |
| 36 #endif | 37 #endif |
| 37 ); | 38 ); |
| 38 | 39 |
| 39 #if defined(OS_CHROMEOS) | 40 #if defined(OS_CHROMEOS) |
| 40 void SyslogsComplete(chromeos::system::LogDictionaryType* logs, | 41 void SyslogsComplete(chromeos::system::LogDictionaryType* logs, |
| 41 std::string* zip_content); | 42 std::string* zip_content); |
| 42 #endif | 43 #endif |
| 43 | 44 |
| 44 const std::string& target_tab_url() const { return target_tab_url_; } | 45 const std::string& target_tab_url() const { return target_tab_url_; } |
| 45 | 46 |
| 46 int problem_type() const { return problem_type_; } | 47 int problem_type() const { return problem_type_; } |
| 47 const std::string& page_url() const { return page_url_; } | 48 const std::string& page_url() const { return page_url_; } |
| 48 const std::string& description() const { return description_; } | 49 const std::string& description() const { return description_; } |
| 49 const std::vector<unsigned char>& image() const { return image_; } | 50 ScreenshotDataPtr image() const { return image_; } |
| 50 #if defined(OS_CHROMEOS) | 51 #if defined(OS_CHROMEOS) |
| 51 const std::string& user_email() const { return user_email_; } | 52 const std::string& user_email() const { return user_email_; } |
| 52 chromeos::system::LogDictionaryType* sys_info() const { return sys_info_; } | 53 chromeos::system::LogDictionaryType* sys_info() const { return sys_info_; } |
| 53 bool send_sys_info() const { return send_sys_info_; } | 54 bool send_sys_info() const { return send_sys_info_; } |
| 54 bool sent_report() const { return sent_report_; } | 55 bool sent_report() const { return sent_report_; } |
| 55 std::string* zip_content() const { return zip_content_; } | 56 std::string* zip_content() const { return zip_content_; } |
| 56 #endif | 57 #endif |
| 57 | 58 |
| 58 | 59 |
| 59 private: | 60 private: |
| 60 Profile* profile_; | 61 Profile* profile_; |
| 61 | 62 |
| 62 // Target tab url. | 63 // Target tab url. |
| 63 std::string target_tab_url_; | 64 std::string target_tab_url_; |
| 64 | 65 |
| 65 int problem_type_; | 66 int problem_type_; |
| 66 std::string page_url_; | 67 std::string page_url_; |
| 67 std::string description_; | 68 std::string description_; |
| 68 std::vector<unsigned char> image_; | 69 ScreenshotDataPtr image_; |
| 69 | 70 |
| 70 #if defined(OS_CHROMEOS) | 71 #if defined(OS_CHROMEOS) |
| 71 // Chromeos specific values for SendReport. | 72 // Chromeos specific values for SendReport. |
| 72 std::string user_email_; | 73 std::string user_email_; |
| 73 chromeos::system::LogDictionaryType* sys_info_; | 74 chromeos::system::LogDictionaryType* sys_info_; |
| 74 // Content of the compressed system logs. | 75 // Content of the compressed system logs. |
| 75 std::string* zip_content_; | 76 std::string* zip_content_; |
| 76 // NOTE: Extra boolean sent_report_ is required because callback may | 77 // NOTE: Extra boolean sent_report_ is required because callback may |
| 77 // occur before or after we call SendReport(). | 78 // occur before or after we call SendReport(). |
| 78 bool sent_report_; | 79 bool sent_report_; |
| 79 // Flag to indicate to SyslogsComplete that it should send the report | 80 // Flag to indicate to SyslogsComplete that it should send the report |
| 80 bool send_sys_info_; | 81 bool send_sys_info_; |
| 81 #endif | 82 #endif |
| 82 }; | 83 }; |
| 83 | 84 |
| 84 #endif // CHROME_BROWSER_BUG_REPORT_DATA_H_ | 85 #endif // CHROME_BROWSER_BUG_REPORT_DATA_H_ |
| OLD | NEW |