| 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 #include "chrome/browser/bug_report_util.h" | 5 #include "chrome/browser/bug_report_util.h" |
| 6 | 6 |
| 7 #include <sstream> | 7 #include <sstream> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 if (line_count > kMaxLineCount) | 251 if (line_count > kMaxLineCount) |
| 252 return false; | 252 return false; |
| 253 } | 253 } |
| 254 } | 254 } |
| 255 return true; | 255 return true; |
| 256 } | 256 } |
| 257 #endif | 257 #endif |
| 258 | 258 |
| 259 // static | 259 // static |
| 260 void BugReportUtil::SendReport(Profile* profile, | 260 void BugReportUtil::SendReport(Profile* profile, |
| 261 const std::string& page_title_text, | |
| 262 int problem_type, | 261 int problem_type, |
| 263 const std::string& page_url_text, | 262 const std::string& page_url_text, |
| 264 const std::string& description, | 263 const std::string& description, |
| 265 const char* png_data, | 264 const char* png_data, |
| 266 int png_data_length, | 265 int png_data_length, |
| 267 int png_width, | 266 int png_width, |
| 268 #if defined(OS_CHROMEOS) | 267 #if defined(OS_CHROMEOS) |
| 269 int png_height, | 268 int png_height, |
| 270 const std::string& user_email_text, | 269 const std::string& user_email_text, |
| 271 const char* zipped_logs_data, | 270 const char* zipped_logs_data, |
| 272 int zipped_logs_length, | 271 int zipped_logs_length, |
| 273 const chromeos::LogDictionaryType* const sys_info) { | 272 const chromeos::LogDictionaryType* const sys_info) { |
| 274 #else | 273 #else |
| 275 int png_height) { | 274 int png_height) { |
| 276 #endif | 275 #endif |
| 277 // Create google feedback protocol buffer objects | 276 // Create google feedback protocol buffer objects |
| 278 userfeedback::ExternalExtensionSubmit feedback_data; | 277 userfeedback::ExternalExtensionSubmit feedback_data; |
| 279 // type id set to 0, unused field but needs to be initialized to 0 | 278 // type id set to 0, unused field but needs to be initialized to 0 |
| 280 feedback_data.set_type_id(0); | 279 feedback_data.set_type_id(0); |
| 281 | 280 |
| 282 userfeedback::CommonData* common_data = feedback_data.mutable_common_data(); | 281 userfeedback::CommonData* common_data = feedback_data.mutable_common_data(); |
| 283 userfeedback::WebData* web_data = feedback_data.mutable_web_data(); | 282 userfeedback::WebData* web_data = feedback_data.mutable_web_data(); |
| 284 | 283 |
| 285 // Set GAIA id to 0. We're not using gaia id's for recording | 284 // Set GAIA id to 0. We're not using gaia id's for recording |
| 286 // use feedback - we're using the e-mail field, allows users to | 285 // use feedback - we're using the e-mail field, allows users to |
| 287 // submit feedback from incognito mode and specify any mail id | 286 // submit feedback from incognito mode and specify any mail id |
| 288 // they wish | 287 // they wish |
| 289 common_data->set_gaia_id(0); | 288 common_data->set_gaia_id(0); |
| 290 | 289 |
| 291 // Add the page title. | |
| 292 AddFeedbackData(&feedback_data, std::string(kPageTitleTag), | |
| 293 page_title_text); | |
| 294 | |
| 295 #if defined(OS_CHROMEOS) | 290 #if defined(OS_CHROMEOS) |
| 296 // Add the user e-mail to the feedback object | 291 // Add the user e-mail to the feedback object |
| 297 common_data->set_user_email(user_email_text); | 292 common_data->set_user_email(user_email_text); |
| 298 #endif | 293 #endif |
| 299 | 294 |
| 300 // Add the description to the feedback object | 295 // Add the description to the feedback object |
| 301 common_data->set_description(description); | 296 common_data->set_description(description); |
| 302 | 297 |
| 303 // Add the language | 298 // Add the language |
| 304 std::string chrome_locale = g_browser_process->GetApplicationLocale(); | 299 std::string chrome_locale = g_browser_process->GetApplicationLocale(); |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 389 | 384 |
| 390 // static | 385 // static |
| 391 void BugReportUtil::ReportPhishing(TabContents* currentTab, | 386 void BugReportUtil::ReportPhishing(TabContents* currentTab, |
| 392 const std::string& phishing_url) { | 387 const std::string& phishing_url) { |
| 393 currentTab->controller().LoadURL( | 388 currentTab->controller().LoadURL( |
| 394 safe_browsing_util::GeneratePhishingReportUrl( | 389 safe_browsing_util::GeneratePhishingReportUrl( |
| 395 kReportPhishingUrl, phishing_url), | 390 kReportPhishingUrl, phishing_url), |
| 396 GURL(), | 391 GURL(), |
| 397 PageTransition::LINK); | 392 PageTransition::LINK); |
| 398 } | 393 } |
| OLD | NEW |