OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/feedback/feedback_data.h" | 5 #include "chrome/browser/feedback/feedback_data.h" |
6 | 6 |
7 #include "chrome/browser/feedback/feedback_util.h" | 7 #include "chrome/browser/feedback/feedback_util.h" |
8 #include "content/public/browser/browser_thread.h" | 8 #include "content/public/browser/browser_thread.h" |
9 | 9 |
10 #if defined(OS_CHROMEOS) | 10 #if defined(OS_CHROMEOS) |
(...skipping 13 matching lines...) Expand all Loading... |
24 { | 24 { |
25 } | 25 } |
26 | 26 |
27 FeedbackData::~FeedbackData() {} | 27 FeedbackData::~FeedbackData() {} |
28 | 28 |
29 void FeedbackData::UpdateData(Profile* profile, | 29 void FeedbackData::UpdateData(Profile* profile, |
30 const std::string& target_tab_url, | 30 const std::string& target_tab_url, |
31 const std::string& category_tag, | 31 const std::string& category_tag, |
32 const std::string& page_url, | 32 const std::string& page_url, |
33 const std::string& description, | 33 const std::string& description, |
| 34 const std::string& user_email, |
34 ScreenshotDataPtr image | 35 ScreenshotDataPtr image |
35 #if defined(OS_CHROMEOS) | 36 #if defined(OS_CHROMEOS) |
36 , const std::string& user_email | |
37 , const bool send_sys_info | 37 , const bool send_sys_info |
38 , const bool sent_report | 38 , const bool sent_report |
39 , const std::string& timestamp | 39 , const std::string& timestamp |
40 #endif | 40 #endif |
41 ) { | 41 ) { |
42 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 42 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
43 profile_ = profile; | 43 profile_ = profile; |
44 target_tab_url_ = target_tab_url; | 44 target_tab_url_ = target_tab_url; |
45 category_tag_ = category_tag; | 45 category_tag_ = category_tag; |
46 page_url_ = page_url; | 46 page_url_ = page_url; |
47 description_ = description; | 47 description_ = description; |
| 48 user_email_ = user_email; |
48 image_ = image; | 49 image_ = image; |
49 #if defined(OS_CHROMEOS) | 50 #if defined(OS_CHROMEOS) |
50 user_email_ = user_email; | |
51 send_sys_info_ = send_sys_info; | 51 send_sys_info_ = send_sys_info; |
52 sent_report_ = sent_report; | 52 sent_report_ = sent_report; |
53 timestamp_ = timestamp; | 53 timestamp_ = timestamp; |
54 #endif | 54 #endif |
55 } | 55 } |
56 | 56 |
57 void FeedbackData::SendReport() { | 57 void FeedbackData::SendReport() { |
58 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 58 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
59 #if defined(OS_CHROMEOS) | 59 #if defined(OS_CHROMEOS) |
60 if (sent_report_) | 60 if (sent_report_) |
61 return; // We already received the syslogs and sent the report. | 61 return; // We already received the syslogs and sent the report. |
62 | 62 |
63 // Set send_report_ to ensure that we only send one report. | 63 // Set send_report_ to ensure that we only send one report. |
64 sent_report_ = true; | 64 sent_report_ = true; |
65 #endif | 65 #endif |
66 | 66 |
67 gfx::Rect& screen_size = FeedbackUtil::GetScreenshotSize(); | 67 gfx::Rect& screen_size = FeedbackUtil::GetScreenshotSize(); |
68 FeedbackUtil::SendReport(profile_ | 68 FeedbackUtil::SendReport(profile_ |
69 , category_tag_ | 69 , category_tag_ |
70 , page_url_ | 70 , page_url_ |
71 , description_ | 71 , description_ |
| 72 , user_email_ |
72 , image_ | 73 , image_ |
73 , screen_size.width() | 74 , screen_size.width() |
74 , screen_size.height() | 75 , screen_size.height() |
75 #if defined(OS_CHROMEOS) | 76 #if defined(OS_CHROMEOS) |
76 , user_email_ | |
77 , zip_content_ ? zip_content_->c_str() : NULL | 77 , zip_content_ ? zip_content_->c_str() : NULL |
78 , zip_content_ ? zip_content_->length() : 0 | 78 , zip_content_ ? zip_content_->length() : 0 |
79 , send_sys_info_ ? sys_info_ : NULL | 79 , send_sys_info_ ? sys_info_ : NULL |
80 , timestamp_ | 80 , timestamp_ |
81 #endif | 81 #endif |
82 ); | 82 ); |
83 | 83 |
84 #if defined(OS_CHROMEOS) | 84 #if defined(OS_CHROMEOS) |
85 if (sys_info_) { | 85 if (sys_info_) { |
86 delete sys_info_; | 86 delete sys_info_; |
(...skipping 25 matching lines...) Expand all Loading... |
112 } else { | 112 } else { |
113 zip_content_ = zip_content; | 113 zip_content_ = zip_content; |
114 sys_info_ = logs; // Will get deleted when SendReport() is called. | 114 sys_info_ = logs; // Will get deleted when SendReport() is called. |
115 if (send_sys_info_) { | 115 if (send_sys_info_) { |
116 // We already prepared the report, send it now. | 116 // We already prepared the report, send it now. |
117 this->SendReport(); | 117 this->SendReport(); |
118 } | 118 } |
119 } | 119 } |
120 } | 120 } |
121 #endif | 121 #endif |
OLD | NEW |