OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #include "chrome/browser/bug_report_data.h" | 5 #include "chrome/browser/bug_report_data.h" |
6 | 6 |
7 #include "chrome/browser/ui/browser.h" | 7 #include "chrome/browser/ui/browser.h" |
8 | 8 |
9 #if defined(OS_CHROMEOS) | 9 #if defined(OS_CHROMEOS) |
10 #include "chrome/browser/chromeos/notifications/system_notification.h" | 10 #include "chrome/browser/chromeos/notifications/system_notification.h" |
11 #endif | 11 #endif |
12 | 12 |
| 13 BugReportData::BugReportData() |
| 14 : profile_(NULL), |
| 15 problem_type_(0) |
| 16 #if defined(OS_CHROMEOS) |
| 17 , sent_report_(false), send_sys_info_(false) |
| 18 #endif |
| 19 { |
| 20 } |
| 21 |
| 22 BugReportData::~BugReportData() {} |
| 23 |
| 24 void BugReportData::UpdateData(Profile* profile, |
| 25 const std::string& target_tab_url, |
| 26 const string16& target_tab_title, |
| 27 const int problem_type, |
| 28 const std::string& page_url, |
| 29 const std::string& description, |
| 30 const std::vector<unsigned char>& image |
| 31 #if defined(OS_CHROMEOS) |
| 32 , const std::string& user_email |
| 33 , const bool send_sys_info |
| 34 , const bool sent_report |
| 35 #endif |
| 36 ) { |
| 37 profile_ = profile; |
| 38 target_tab_url_ = target_tab_url; |
| 39 target_tab_title_ = target_tab_title; |
| 40 problem_type_ = problem_type; |
| 41 page_url_ = page_url; |
| 42 description_ = description; |
| 43 image_ = image; |
| 44 #if defined(OS_CHROMEOS) |
| 45 user_email_ = user_email; |
| 46 send_sys_info_ = send_sys_info; |
| 47 sent_report_ = sent_report; |
| 48 #endif |
| 49 } |
13 | 50 |
14 | 51 |
15 #if defined(OS_CHROMEOS) | 52 #if defined(OS_CHROMEOS) |
16 // Called from the same thread as HandleGetDialogDefaults, i.e. the UI thread. | 53 // Called from the same thread as HandleGetDialogDefaults, i.e. the UI thread. |
17 void BugReportData::SyslogsComplete(chromeos::LogDictionaryType* logs, | 54 void BugReportData::SyslogsComplete(chromeos::LogDictionaryType* logs, |
18 std::string* zip_content) { | 55 std::string* zip_content) { |
19 if (sent_report_) { | 56 if (sent_report_) { |
20 // We already sent the report, just delete the data. | 57 // We already sent the report, just delete the data. |
21 if (logs) | 58 if (logs) |
22 delete logs; | 59 delete logs; |
23 if (zip_content) | 60 if (zip_content) |
24 delete zip_content; | 61 delete zip_content; |
25 } else { | 62 } else { |
26 zip_content_ = zip_content; | 63 zip_content_ = zip_content; |
27 sys_info_ = logs; // Will get deleted when SendReport() is called. | 64 sys_info_ = logs; // Will get deleted when SendReport() is called. |
28 if (send_sys_info_) { | 65 if (send_sys_info_) { |
29 // We already prepared the report, send it now. | 66 // We already prepared the report, send it now. |
30 this->SendReport(); | 67 this->SendReport(); |
31 } | 68 } |
32 } | 69 } |
33 } | 70 } |
34 #endif | 71 #endif |
OLD | NEW |