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/views/bug_report_view.h" | 5 #include "chrome/browser/views/bug_report_view.h" |
6 | 6 |
7 #include "app/combobox_model.h" | 7 #include "app/combobox_model.h" |
8 #include "app/l10n_util.h" | 8 #include "app/l10n_util.h" |
9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
11 #include "base/file_version_info.h" | 11 #include "base/file_version_info.h" |
12 #include "base/path_service.h" | 12 #include "base/path_service.h" |
13 #include "base/utf_string_conversions.h" | 13 #include "base/utf_string_conversions.h" |
14 #include "base/waitable_event.h" | 14 #include "base/waitable_event.h" |
15 #include "chrome/app/chrome_version_info.h" | 15 #include "chrome/app/chrome_version_info.h" |
16 #include "chrome/browser/bug_report_util.h" | 16 #include "chrome/browser/bug_report_util.h" |
17 #include "chrome/browser/pref_service.h" | 17 #include "chrome/browser/pref_service.h" |
18 #include "chrome/browser/profile.h" | 18 #include "chrome/browser/profile.h" |
19 #include "chrome/browser/browser_list.h" | 19 #include "chrome/browser/browser_list.h" |
20 #include "chrome/browser/chrome_thread.h" | 20 #include "chrome/browser/chrome_thread.h" |
21 #include "chrome/browser/safe_browsing/safe_browsing_util.h" | 21 #include "chrome/browser/safe_browsing/safe_browsing_util.h" |
22 #include "chrome/browser/tab_contents/navigation_controller.h" | 22 #include "chrome/browser/tab_contents/navigation_controller.h" |
23 #include "chrome/browser/tab_contents/navigation_entry.h" | 23 #include "chrome/browser/tab_contents/navigation_entry.h" |
24 #include "chrome/browser/tab_contents/tab_contents.h" | 24 #include "chrome/browser/tab_contents/tab_contents.h" |
25 #include "chrome/common/chrome_paths.h" | 25 #include "chrome/common/chrome_paths.h" |
26 #include "chrome/common/net/url_fetcher.h" | 26 #include "chrome/common/net/url_fetcher.h" |
27 #include "chrome/common/pref_names.h" | 27 #include "chrome/common/pref_names.h" |
| 28 #include "chrome/common/url_constants.h" |
28 #include "grit/chromium_strings.h" | 29 #include "grit/chromium_strings.h" |
29 #include "grit/generated_resources.h" | 30 #include "grit/generated_resources.h" |
30 #include "grit/locale_settings.h" | 31 #include "grit/locale_settings.h" |
31 #include "net/base/escape.h" | 32 #include "net/base/escape.h" |
32 #include "unicode/locid.h" | 33 #include "unicode/locid.h" |
33 #include "views/controls/button/checkbox.h" | 34 #include "views/controls/button/checkbox.h" |
34 #include "views/controls/label.h" | 35 #include "views/controls/label.h" |
35 #include "views/grid_layout.h" | 36 #include "views/grid_layout.h" |
36 #include "views/standard_layout.h" | 37 #include "views/standard_layout.h" |
37 #include "views/widget/widget.h" | 38 #include "views/widget/widget.h" |
(...skipping 11 matching lines...) Expand all Loading... |
49 #endif | 50 #endif |
50 | 51 |
51 using views::ColumnSet; | 52 using views::ColumnSet; |
52 using views::GridLayout; | 53 using views::GridLayout; |
53 | 54 |
54 // Report a bug data version. | 55 // Report a bug data version. |
55 static const int kBugReportVersion = 1; | 56 static const int kBugReportVersion = 1; |
56 static const int kScreenImageRadioGroup = 2; | 57 static const int kScreenImageRadioGroup = 2; |
57 static const char kScreenshotsRelativePath[] = "/Screenshots"; | 58 static const char kScreenshotsRelativePath[] = "/Screenshots"; |
58 static const char kScreenshotPattern[] = "*.png"; | 59 static const char kScreenshotPattern[] = "*.png"; |
59 static const char kAboutBlank[] = "about:blank"; | |
60 static const char kSystemInformationUrl[] = "about:system"; | |
61 | 60 |
62 // Number of lines description field can display at one time. | 61 // Number of lines description field can display at one time. |
63 static const int kDescriptionLines = 5; | 62 static const int kDescriptionLines = 5; |
64 | 63 |
65 class BugReportComboBoxModel : public ComboboxModel { | 64 class BugReportComboBoxModel : public ComboboxModel { |
66 public: | 65 public: |
67 BugReportComboBoxModel() {} | 66 BugReportComboBoxModel() {} |
68 | 67 |
69 // ComboboxModel interface. | 68 // ComboboxModel interface. |
70 virtual int GetItemCount() { | 69 virtual int GetItemCount() { |
(...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
601 } | 600 } |
602 } | 601 } |
603 return true; | 602 return true; |
604 } | 603 } |
605 | 604 |
606 #if defined(OS_CHROMEOS) | 605 #if defined(OS_CHROMEOS) |
607 void BugReportView::LinkActivated(views::Link* source, | 606 void BugReportView::LinkActivated(views::Link* source, |
608 int event_flags) { | 607 int event_flags) { |
609 GURL url; | 608 GURL url; |
610 if (source == system_information_url_control_) { | 609 if (source == system_information_url_control_) { |
611 url = GURL(kSystemInformationUrl); | 610 url = GURL(chrome::kAboutSystemURL); |
612 } else { | 611 } else { |
613 NOTREACHED() << "Unknown link source"; | 612 NOTREACHED() << "Unknown link source"; |
614 return; | 613 return; |
615 } | 614 } |
616 | 615 |
617 Browser* browser = BrowserList::GetLastActive(); | 616 Browser* browser = BrowserList::GetLastActive(); |
618 if (browser) | 617 if (browser) |
619 browser->OpenURL(url, GURL(), NEW_FOREGROUND_TAB, PageTransition::LINK); | 618 browser->OpenURL(url, GURL(), NEW_FOREGROUND_TAB, PageTransition::LINK); |
620 } | 619 } |
621 #endif | 620 #endif |
622 | 621 |
623 | 622 |
624 views::View* BugReportView::GetContentsView() { | 623 views::View* BugReportView::GetContentsView() { |
625 return this; | 624 return this; |
626 } | 625 } |
OLD | NEW |