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/views/bug_report_view.h" | 5 #include "chrome/browser/views/bug_report_view.h" |
6 | 6 |
7 #include <iostream> | 7 #include <iostream> |
8 #include <fstream> | 8 #include <fstream> |
9 | 9 |
10 #include "app/l10n_util.h" | 10 #include "app/l10n_util.h" |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 l10n_util::GetString(IDS_BUGREPORT_BUG_TYPE)); | 193 l10n_util::GetString(IDS_BUGREPORT_BUG_TYPE)); |
194 bug_type_combo_ = new views::ComboBox(bug_type_model_.get()); | 194 bug_type_combo_ = new views::ComboBox(bug_type_model_.get()); |
195 bug_type_combo_->SetListener(this); | 195 bug_type_combo_->SetListener(this); |
196 | 196 |
197 page_title_label_ = new views::Label( | 197 page_title_label_ = new views::Label( |
198 l10n_util::GetString(IDS_BUGREPORT_REPORT_PAGE_TITLE)); | 198 l10n_util::GetString(IDS_BUGREPORT_REPORT_PAGE_TITLE)); |
199 page_title_text_ = new views::Label(UTF16ToWideHack(tab_->GetTitle())); | 199 page_title_text_ = new views::Label(UTF16ToWideHack(tab_->GetTitle())); |
200 page_url_label_ = new views::Label( | 200 page_url_label_ = new views::Label( |
201 l10n_util::GetString(IDS_BUGREPORT_REPORT_URL_LABEL)); | 201 l10n_util::GetString(IDS_BUGREPORT_REPORT_URL_LABEL)); |
202 // page_url_text_'s text (if any) is filled in after dialog creation | 202 // page_url_text_'s text (if any) is filled in after dialog creation |
203 page_url_text_ = new views::TextField; | 203 page_url_text_ = new views::Textfield; |
204 page_url_text_->SetController(this); | 204 page_url_text_->SetController(this); |
205 | 205 |
206 description_label_ = new views::Label( | 206 description_label_ = new views::Label( |
207 l10n_util::GetString(IDS_BUGREPORT_DESCRIPTION_LABEL)); | 207 l10n_util::GetString(IDS_BUGREPORT_DESCRIPTION_LABEL)); |
208 description_text_ = | 208 description_text_ = |
209 new views::TextField(views::TextField::STYLE_MULTILINE); | 209 new views::Textfield(views::Textfield::STYLE_MULTILINE); |
210 description_text_->SetHeightInLines(kDescriptionLines); | 210 description_text_->SetHeightInLines(kDescriptionLines); |
211 | 211 |
212 include_page_source_checkbox_ = new views::Checkbox( | 212 include_page_source_checkbox_ = new views::Checkbox( |
213 l10n_util::GetString(IDS_BUGREPORT_INCLUDE_PAGE_SOURCE_CHKBOX)); | 213 l10n_util::GetString(IDS_BUGREPORT_INCLUDE_PAGE_SOURCE_CHKBOX)); |
214 include_page_source_checkbox_->SetChecked(true); | 214 include_page_source_checkbox_->SetChecked(true); |
215 include_page_image_checkbox_ = new views::Checkbox( | 215 include_page_image_checkbox_ = new views::Checkbox( |
216 l10n_util::GetString(IDS_BUGREPORT_INCLUDE_PAGE_IMAGE_CHKBOX)); | 216 l10n_util::GetString(IDS_BUGREPORT_INCLUDE_PAGE_IMAGE_CHKBOX)); |
217 include_page_image_checkbox_->SetChecked(true); | 217 include_page_image_checkbox_->SetChecked(true); |
218 | 218 |
219 // Arranges controls by using GridLayout. | 219 // Arranges controls by using GridLayout. |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 old_report_text_.clear(); | 291 old_report_text_.clear(); |
292 } | 292 } |
293 include_page_source_checkbox_->SetEnabled(!is_phishing_report); | 293 include_page_source_checkbox_->SetEnabled(!is_phishing_report); |
294 include_page_source_checkbox_->SetChecked(!is_phishing_report); | 294 include_page_source_checkbox_->SetChecked(!is_phishing_report); |
295 include_page_image_checkbox_->SetEnabled(!is_phishing_report); | 295 include_page_image_checkbox_->SetEnabled(!is_phishing_report); |
296 include_page_image_checkbox_->SetChecked(!is_phishing_report); | 296 include_page_image_checkbox_->SetChecked(!is_phishing_report); |
297 | 297 |
298 GetDialogClientView()->UpdateDialogButtons(); | 298 GetDialogClientView()->UpdateDialogButtons(); |
299 } | 299 } |
300 | 300 |
301 void BugReportView::ContentsChanged(views::TextField* sender, | 301 void BugReportView::ContentsChanged(views::Textfield* sender, |
302 const std::wstring& new_contents) { | 302 const std::wstring& new_contents) { |
303 } | 303 } |
304 | 304 |
305 bool BugReportView::HandleKeystroke(views::TextField* sender, | 305 bool BugReportView::HandleKeystroke(views::Textfield* sender, |
306 const views::TextField::Keystroke& key) { | 306 const views::Textfield::Keystroke& key) { |
307 return false; | 307 return false; |
308 } | 308 } |
309 | 309 |
310 std::wstring BugReportView::GetDialogButtonLabel( | 310 std::wstring BugReportView::GetDialogButtonLabel( |
311 MessageBoxFlags::DialogButton button) const { | 311 MessageBoxFlags::DialogButton button) const { |
312 if (button == MessageBoxFlags::DIALOGBUTTON_OK) { | 312 if (button == MessageBoxFlags::DIALOGBUTTON_OK) { |
313 if (problem_type_ == BugReportComboBoxModel::PHISHING_PAGE) | 313 if (problem_type_ == BugReportComboBoxModel::PHISHING_PAGE) |
314 return l10n_util::GetString(IDS_BUGREPORT_SEND_PHISHING_REPORT); | 314 return l10n_util::GetString(IDS_BUGREPORT_SEND_PHISHING_REPORT); |
315 else | 315 else |
316 return l10n_util::GetString(IDS_BUGREPORT_SEND_REPORT); | 316 return l10n_util::GetString(IDS_BUGREPORT_SEND_REPORT); |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
519 fetcher->Start(); | 519 fetcher->Start(); |
520 } | 520 } |
521 | 521 |
522 void BugReportView::ReportPhishing() { | 522 void BugReportView::ReportPhishing() { |
523 tab_->controller().LoadURL( | 523 tab_->controller().LoadURL( |
524 safe_browsing_util::GeneratePhishingReportUrl( | 524 safe_browsing_util::GeneratePhishingReportUrl( |
525 kReportPhishingUrl, WideToUTF8(page_url_text_->GetText())), | 525 kReportPhishingUrl, WideToUTF8(page_url_text_->GetText())), |
526 GURL(), | 526 GURL(), |
527 PageTransition::LINK); | 527 PageTransition::LINK); |
528 } | 528 } |
OLD | NEW |