| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "base/file_version_info.h" | 8 #include "base/file_version_info.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "chrome/app/chrome_version_info.h" |
| 10 #include "chrome/browser/browser_process_impl.h" | 11 #include "chrome/browser/browser_process_impl.h" |
| 11 #include "chrome/browser/net/url_fetcher.h" | 12 #include "chrome/browser/net/url_fetcher.h" |
| 12 #include "chrome/browser/profile.h" | 13 #include "chrome/browser/profile.h" |
| 13 #include "chrome/browser/safe_browsing/safe_browsing_util.h" | 14 #include "chrome/browser/safe_browsing/safe_browsing_util.h" |
| 14 #include "chrome/browser/tab_contents/tab_contents.h" | 15 #include "chrome/browser/tab_contents/tab_contents.h" |
| 15 #include "googleurl/src/gurl.h" | 16 #include "googleurl/src/gurl.h" |
| 16 #include "grit/locale_settings.h" | 17 #include "grit/locale_settings.h" |
| 17 #include "unicode/locid.h" | 18 #include "unicode/locid.h" |
| 18 | 19 |
| 19 namespace { | 20 namespace { |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 else | 138 else |
| 138 post_body.append(page_url_text + "\r\n"); | 139 post_body.append(page_url_text + "\r\n"); |
| 139 | 140 |
| 140 // Add Chrome version. | 141 // Add Chrome version. |
| 141 post_body.append("--" + mime_boundary + "\r\n"); | 142 post_body.append("--" + mime_boundary + "\r\n"); |
| 142 post_body.append("Content-Disposition: form-data; " | 143 post_body.append("Content-Disposition: form-data; " |
| 143 "name=\"chrome_version\"\r\n\r\n"); | 144 "name=\"chrome_version\"\r\n\r\n"); |
| 144 | 145 |
| 145 std::string chrome_version; | 146 std::string chrome_version; |
| 146 scoped_ptr<FileVersionInfo> version_info( | 147 scoped_ptr<FileVersionInfo> version_info( |
| 147 FileVersionInfo::CreateFileVersionInfoForCurrentModule()); | 148 chrome_app::GetChromeVersionInfo()); |
| 148 if (version_info.get()) { | 149 if (version_info.get()) { |
| 149 chrome_version = WideToUTF8(version_info->product_name()) + " - " + | 150 chrome_version = WideToUTF8(version_info->product_name()) + " - " + |
| 150 WideToUTF8(version_info->file_version()) + | 151 WideToUTF8(version_info->file_version()) + |
| 151 " (" + WideToUTF8(version_info->last_change()) + ")"; | 152 " (" + WideToUTF8(version_info->last_change()) + ")"; |
| 152 } | 153 } |
| 153 | 154 |
| 154 if (chrome_version.empty()) | 155 if (chrome_version.empty()) |
| 155 post_body.append("n/a\r\n"); | 156 post_body.append("n/a\r\n"); |
| 156 else | 157 else |
| 157 post_body.append(chrome_version + "\r\n"); | 158 post_body.append(chrome_version + "\r\n"); |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 // static | 230 // static |
| 230 void BugReportUtil::ReportPhishing(TabContents* currentTab, | 231 void BugReportUtil::ReportPhishing(TabContents* currentTab, |
| 231 const std::string& phishing_url) { | 232 const std::string& phishing_url) { |
| 232 currentTab->controller().LoadURL( | 233 currentTab->controller().LoadURL( |
| 233 safe_browsing_util::GeneratePhishingReportUrl( | 234 safe_browsing_util::GeneratePhishingReportUrl( |
| 234 kReportPhishingUrl, phishing_url), | 235 kReportPhishingUrl, phishing_url), |
| 235 GURL(), | 236 GURL(), |
| 236 PageTransition::LINK); | 237 PageTransition::LINK); |
| 237 } | 238 } |
| 238 | 239 |
| OLD | NEW |