diff options
author | feldstein@chromium.org <feldstein@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-29 03:35:23 +0000 |
---|---|---|
committer | feldstein@chromium.org <feldstein@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-29 03:35:23 +0000 |
commit | 10e457c06f9926bcd116e2314b6721437ee86e54 (patch) | |
tree | 4c6036a0c086f6ee5c997f7e0344041da9743983 | |
parent | 2cbac9eb5be45ba99a37b28eb1dbf306ee3e67cd (diff) | |
download | chromium_src-10e457c06f9926bcd116e2314b6721437ee86e54.zip chromium_src-10e457c06f9926bcd116e2314b6721437ee86e54.tar.gz chromium_src-10e457c06f9926bcd116e2314b6721437ee86e54.tar.bz2 |
Change report bad webpage to be a web tab instead of native dialog
Change all 3 implementations of the report broken page dialog to just use one
web form.
BUG=none
TEST=Make sure you can report bad pages on each platform
Review URL: http://codereview.chromium.org/1737016
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45908 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/browser.cc | 27 | ||||
-rw-r--r-- | chrome/browser/browser.h | 1 | ||||
-rw-r--r-- | chrome/browser/cocoa/browser_window_cocoa.mm | 6 | ||||
-rw-r--r-- | chrome/browser/page_menu_model.cc | 5 |
4 files changed, 27 insertions, 12 deletions
diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc index f810c7e..0dd870c 100644 --- a/chrome/browser/browser.cc +++ b/chrome/browser/browser.cc @@ -119,6 +119,12 @@ static const int kUIUpdateCoalescingTimeMS = 200; static const char* const kHelpContentUrl = "http://www.google.com/support/chrome/"; +// The URL to be loaded to display the "Report a broken page" form. +static const std::string kBrokenPageUrl = + "http://www.google.com/support/chrome/bin/request.py?contact_type=" + "broken_website&format=inproduct&p.page_title=$1&p.page_url=$2"; + + /////////////////////////////////////////////////////////////////////////////// namespace { @@ -1486,8 +1492,10 @@ void Browser::OpenNewProfileDialog() { } void Browser::OpenBugReportDialog() { - UserMetrics::RecordAction(UserMetricsAction("ReportBug"), profile_); - window_->ShowReportBugDialog(); + TabContents* contents = GetSelectedTabContents(); + if (!contents) + return; + ShowBrokenPageTab(contents); } void Browser::ToggleBookmarkBar() { @@ -1552,6 +1560,21 @@ void Browser::ShowExtensionsTab() { ShowSingletonTab(GURL(chrome::kChromeUIExtensionsURL)); } +void Browser::ShowBrokenPageTab(TabContents* contents) { + UserMetrics::RecordAction(UserMetricsAction("ReportBug"), profile_); + string16 page_title = contents->GetTitle(); + NavigationEntry* entry = contents->controller().GetActiveEntry(); + if (!entry) + return; + std::string page_url = entry->url().spec(); + std::vector<std::string> subst; + subst.push_back(UTF16ToASCII(page_title)); + subst.push_back(page_url); + std::string report_page_url = + ReplaceStringPlaceholders(kBrokenPageUrl, subst, NULL); + ShowSingletonTab(GURL(report_page_url)); +} + void Browser::OpenClearBrowsingDataDialog() { UserMetrics::RecordAction(UserMetricsAction("ClearBrowsingData_ShowDlg"), profile_); diff --git a/chrome/browser/browser.h b/chrome/browser/browser.h index 6527d2c..3b1eaf4 100644 --- a/chrome/browser/browser.h +++ b/chrome/browser/browser.h @@ -497,6 +497,7 @@ class Browser : public TabStripModelDelegate, void ShowHistoryTab(); void ShowDownloadsTab(); void ShowExtensionsTab(); + void ShowBrokenPageTab(TabContents* contents); void OpenClearBrowsingDataDialog(); void OpenOptionsDialog(); void OpenKeywordEditor(); diff --git a/chrome/browser/cocoa/browser_window_cocoa.mm b/chrome/browser/cocoa/browser_window_cocoa.mm index 1edee48..7946aae 100644 --- a/chrome/browser/cocoa/browser_window_cocoa.mm +++ b/chrome/browser/cocoa/browser_window_cocoa.mm @@ -282,11 +282,7 @@ DownloadShelf* BrowserWindowCocoa::GetDownloadShelf() { void BrowserWindowCocoa::ShowReportBugDialog() { TabContents* current_tab = browser_->GetSelectedTabContents(); if (current_tab && current_tab->controller().GetActiveEntry()) { - BugReportWindowController* controller = - [[BugReportWindowController alloc] - initWithTabContents:current_tab - profile:browser_->profile()]; - [controller runModalDialog]; + browser_->ShowBrokenPageTab(current_tab); } } diff --git a/chrome/browser/page_menu_model.cc b/chrome/browser/page_menu_model.cc index 8e9521c..bf5912a 100644 --- a/chrome/browser/page_menu_model.cc +++ b/chrome/browser/page_menu_model.cc @@ -47,13 +47,8 @@ void PageMenuModel::Build() { devtools_menu_model_.reset(new DevToolsMenuModel(delegate())); AddSubMenuWithStringId(IDS_DEVELOPER_MENU, devtools_menu_model_.get()); -#if !defined(TOOLKIT_GTK) - // The Report Bug menu hasn't been implemented yet for Linux. - // Remove it until it is. - // http://code.google.com/p/chromium/issues/detail?id=11600 AddSeparator(); AddItemWithStringId(IDC_REPORT_BUG, IDS_REPORT_BUG); -#endif } //////////////////////////////////////////////////////////////////////////////// |