Commit 7a19ea21 authored by tfarina@chromium.org's avatar tfarina@chromium.org

chrome: Refactor the way to show the feedback ui and move it into chrome namespace.

BUG=133088
TBR=ben@chromium.org

Review URL: https://chromiumcodereview.appspot.com/10834107

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@149624 0039d316-1c4b-4281-b951-d872f2087c98
parent db943991
...@@ -5,11 +5,11 @@ ...@@ -5,11 +5,11 @@
#include "chrome/browser/autofill/autofill_feedback_infobar_delegate.h" #include "chrome/browser/autofill/autofill_feedback_infobar_delegate.h"
#include "base/utf_string_conversions.h" #include "base/utf_string_conversions.h"
#include "chrome/browser/feedback/proto/extension.pb.h"
#include "chrome/browser/infobars/infobar_tab_helper.h" #include "chrome/browser/infobars/infobar_tab_helper.h"
#include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_finder.h" #include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/webui/feedback_ui.h" #include "chrome/browser/ui/chrome_pages.h"
#include "chrome/browser/feedback/proto/extension.pb.h"
#include "content/public/browser/navigation_controller.h" #include "content/public/browser/navigation_controller.h"
#include "content/public/browser/navigation_details.h" #include "content/public/browser/navigation_details.h"
#include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents.h"
...@@ -45,7 +45,7 @@ string16 AutofillFeedbackInfoBarDelegate::GetLinkText() const { ...@@ -45,7 +45,7 @@ string16 AutofillFeedbackInfoBarDelegate::GetLinkText() const {
bool AutofillFeedbackInfoBarDelegate::LinkClicked( bool AutofillFeedbackInfoBarDelegate::LinkClicked(
WindowOpenDisposition disposition) { WindowOpenDisposition disposition) {
browser::ShowWebFeedbackView( chrome::ShowFeedbackPage(
browser::FindBrowserWithWebContents(owner()->web_contents()), browser::FindBrowserWithWebContents(owner()->web_contents()),
feedback_message_, feedback_message_,
std::string(kCategoryTagAutofill)); std::string(kCategoryTagAutofill));
......
...@@ -140,7 +140,6 @@ ...@@ -140,7 +140,6 @@
#include "chrome/browser/ui/tabs/tab_strip_model.h" #include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/browser/ui/unload_controller.h" #include "chrome/browser/ui/unload_controller.h"
#include "chrome/browser/ui/web_applications/web_app_ui.h" #include "chrome/browser/ui/web_applications/web_app_ui.h"
#include "chrome/browser/ui/webui/feedback_ui.h"
#include "chrome/browser/ui/webui/signin/login_ui_service.h" #include "chrome/browser/ui/webui/signin/login_ui_service.h"
#include "chrome/browser/ui/webui/signin/login_ui_service_factory.h" #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h"
#include "chrome/browser/ui/window_sizer/window_sizer.h" #include "chrome/browser/ui/window_sizer/window_sizer.h"
......
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
#include "chrome/browser/ui/browser_tab_restore_service_delegate.h" #include "chrome/browser/ui/browser_tab_restore_service_delegate.h"
#include "chrome/browser/ui/browser_tabstrip.h" #include "chrome/browser/ui/browser_tabstrip.h"
#include "chrome/browser/ui/browser_window.h" #include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/chrome_pages.h"
#include "chrome/browser/ui/constrained_window_tab_helper.h" #include "chrome/browser/ui/constrained_window_tab_helper.h"
#include "chrome/browser/ui/find_bar/find_bar_controller.h" #include "chrome/browser/ui/find_bar/find_bar_controller.h"
#include "chrome/browser/ui/find_bar/find_tab_helper.h" #include "chrome/browser/ui/find_bar/find_tab_helper.h"
...@@ -49,7 +50,6 @@ ...@@ -49,7 +50,6 @@
#include "chrome/browser/ui/status_bubble.h" #include "chrome/browser/ui/status_bubble.h"
#include "chrome/browser/ui/tab_contents/tab_contents.h" #include "chrome/browser/ui/tab_contents/tab_contents.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h" #include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/browser/ui/webui/feedback_ui.h"
#include "chrome/browser/ui/webui/ntp/app_launcher_handler.h" #include "chrome/browser/ui/webui/ntp/app_launcher_handler.h"
#include "chrome/browser/web_applications/web_app.h" #include "chrome/browser/web_applications/web_app.h"
#include "chrome/common/chrome_switches.h" #include "chrome/common/chrome_switches.h"
...@@ -838,7 +838,7 @@ void OpenTaskManager(Browser* browser, bool highlight_background_resources) { ...@@ -838,7 +838,7 @@ void OpenTaskManager(Browser* browser, bool highlight_background_resources) {
void OpenFeedbackDialog(Browser* browser) { void OpenFeedbackDialog(Browser* browser) {
content::RecordAction(UserMetricsAction("Feedback")); content::RecordAction(UserMetricsAction("Feedback"));
browser::ShowWebFeedbackView(browser, std::string(), std::string()); chrome::ShowFeedbackPage(browser, std::string(), std::string());
} }
void ToggleBookmarkBar(Browser* browser) { void ToggleBookmarkBar(Browser* browser) {
......
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
#ifndef CHROME_BROWSER_UI_CHROME_PAGES_H_ #ifndef CHROME_BROWSER_UI_CHROME_PAGES_H_
#define CHROME_BROWSER_UI_CHROME_PAGES_H_ #define CHROME_BROWSER_UI_CHROME_PAGES_H_
#include <string>
#include "chrome/browser/ui/webui/sync_promo/sync_promo_ui.h" #include "chrome/browser/ui/webui/sync_promo/sync_promo_ui.h"
#include "chrome/common/content_settings_types.h" #include "chrome/common/content_settings_types.h"
...@@ -35,6 +37,9 @@ void ShowHistory(Browser* browser); ...@@ -35,6 +37,9 @@ void ShowHistory(Browser* browser);
void ShowDownloads(Browser* browser); void ShowDownloads(Browser* browser);
void ShowExtensions(Browser* browser); void ShowExtensions(Browser* browser);
void ShowConflicts(Browser* browser); void ShowConflicts(Browser* browser);
void ShowFeedbackPage(Browser* browser,
const std::string& description_template,
const std::string& category_tag);
void ShowHelp(Browser* browser, HelpSource source); void ShowHelp(Browser* browser, HelpSource source);
......
...@@ -71,7 +71,6 @@ ...@@ -71,7 +71,6 @@
#include "chrome/browser/ui/views/toolbar_view.h" #include "chrome/browser/ui/views/toolbar_view.h"
#include "chrome/browser/ui/views/update_recommended_message_box.h" #include "chrome/browser/ui/views/update_recommended_message_box.h"
#include "chrome/browser/ui/views/website_settings/website_settings_popup_view.h" #include "chrome/browser/ui/views/website_settings/website_settings_popup_view.h"
#include "chrome/browser/ui/webui/feedback_ui.h"
#include "chrome/browser/ui/window_sizer/window_sizer.h" #include "chrome/browser/ui/window_sizer/window_sizer.h"
#include "chrome/common/chrome_notification_types.h" #include "chrome/common/chrome_notification_types.h"
#include "chrome/common/chrome_switches.h" #include "chrome/common/chrome_switches.h"
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
#include "chrome/browser/feedback/feedback_util.h" #include "chrome/browser/feedback/feedback_util.h"
#include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_finder.h" #include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/webui/feedback_ui.h" #include "chrome/browser/ui/chrome_pages.h"
#include "chrome/common/url_constants.h" #include "chrome/common/url_constants.h"
#include "content/public/browser/navigation_controller.h" #include "content/public/browser/navigation_controller.h"
#include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents.h"
...@@ -121,7 +121,7 @@ void SadTabView::LinkClicked(views::Link* source, int event_flags) { ...@@ -121,7 +121,7 @@ void SadTabView::LinkClicked(views::Link* source, int event_flags) {
content::PAGE_TRANSITION_LINK, false); content::PAGE_TRANSITION_LINK, false);
web_contents_->OpenURL(params); web_contents_->OpenURL(params);
} else if (source == feedback_link_) { } else if (source == feedback_link_) {
browser::ShowWebFeedbackView( chrome::ShowFeedbackPage(
browser::FindBrowserWithWebContents(web_contents_), browser::FindBrowserWithWebContents(web_contents_),
l10n_util::GetStringUTF8(IDS_KILLED_TAB_FEEDBACK_MESSAGE), l10n_util::GetStringUTF8(IDS_KILLED_TAB_FEEDBACK_MESSAGE),
std::string(kCategoryTagCrash)); std::string(kCategoryTagCrash));
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include "chrome/browser/ui/browser_finder.h" #include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/browser_tabstrip.h" #include "chrome/browser/ui/browser_tabstrip.h"
#include "chrome/browser/ui/browser_window.h" #include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/chrome_pages.h"
#include "chrome/browser/ui/singleton_tabs.h" #include "chrome/browser/ui/singleton_tabs.h"
#include "chrome/browser/ui/tab_contents/tab_contents.h" #include "chrome/browser/ui/tab_contents/tab_contents.h"
#include "chrome/browser/ui/webui/chrome_url_data_manager.h" #include "chrome/browser/ui/webui/chrome_url_data_manager.h"
...@@ -147,12 +148,11 @@ int GetIndexOfFeedbackTab(Browser* browser) { ...@@ -147,12 +148,11 @@ int GetIndexOfFeedbackTab(Browser* browser) {
} // namespace } // namespace
namespace chrome {
namespace browser { void ShowFeedbackPage(Browser* browser,
const std::string& description_template,
void ShowWebFeedbackView(Browser* browser, const std::string& category_tag) {
const std::string& description_template,
const std::string& category_tag) {
#if defined(OS_CHROMEOS) #if defined(OS_CHROMEOS)
// Grab the timestamp before we do anything else - this is crucial to help // Grab the timestamp before we do anything else - this is crucial to help
// diagnose some hardware issues. // diagnose some hardware issues.
...@@ -206,7 +206,7 @@ void ShowWebFeedbackView(Browser* browser, ...@@ -206,7 +206,7 @@ void ShowWebFeedbackView(Browser* browser,
chrome::ShowSingletonTab(browser, GURL(feedback_url)); chrome::ShowSingletonTab(browser, GURL(feedback_url));
} }
} // namespace browser } // namespace chrome
// The handler for Javascript messages related to the "bug report" dialog // The handler for Javascript messages related to the "bug report" dialog
class FeedbackHandler : public WebUIMessageHandler, class FeedbackHandler : public WebUIMessageHandler,
......
...@@ -7,15 +7,10 @@ ...@@ -7,15 +7,10 @@
#include <string> #include <string>
#include "base/basictypes.h"
#include "ui/web_dialogs/web_dialog_ui.h" #include "ui/web_dialogs/web_dialog_ui.h"
class Browser; class FilePath;
namespace browser {
void ShowWebFeedbackView(Browser* browser,
const std::string& description_template,
const std::string& category_tag);
} // namespace browser
class FeedbackUI : public ui::WebDialogUI { class FeedbackUI : public ui::WebDialogUI {
public: public:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment