Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(80)

Side by Side Diff: chrome/browser/ui/views/sad_tab_view.cc

Issue 10834107: chrome: Refactor the way to show the feedback ui and move it into chrome namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/ui/views/sad_tab_view.h" 5 #include "chrome/browser/ui/views/sad_tab_view.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/metrics/field_trial.h" 9 #include "base/metrics/field_trial.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
11 #include "base/utf_string_conversions.h" 11 #include "base/utf_string_conversions.h"
12 #include "chrome/browser/feedback/feedback_util.h" 12 #include "chrome/browser/feedback/feedback_util.h"
13 #include "chrome/browser/ui/browser.h" 13 #include "chrome/browser/ui/browser.h"
14 #include "chrome/browser/ui/browser_finder.h" 14 #include "chrome/browser/ui/browser_finder.h"
15 #include "chrome/browser/ui/webui/feedback_ui.h" 15 #include "chrome/browser/ui/web_feedback_ui.h"
16 #include "chrome/common/url_constants.h" 16 #include "chrome/common/url_constants.h"
17 #include "content/public/browser/navigation_controller.h" 17 #include "content/public/browser/navigation_controller.h"
18 #include "content/public/browser/web_contents.h" 18 #include "content/public/browser/web_contents.h"
19 #include "grit/generated_resources.h" 19 #include "grit/generated_resources.h"
20 #include "grit/theme_resources.h" 20 #include "grit/theme_resources.h"
21 #include "ui/base/l10n/l10n_util.h" 21 #include "ui/base/l10n/l10n_util.h"
22 #include "ui/base/resource/resource_bundle.h" 22 #include "ui/base/resource/resource_bundle.h"
23 #include "ui/gfx/font.h" 23 #include "ui/gfx/font.h"
24 #include "ui/views/controls/button/text_button.h" 24 #include "ui/views/controls/button/text_button.h"
25 #include "ui/views/controls/image_view.h" 25 #include "ui/views/controls/image_view.h"
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 void SadTabView::LinkClicked(views::Link* source, int event_flags) { 114 void SadTabView::LinkClicked(views::Link* source, int event_flags) {
115 DCHECK(web_contents_); 115 DCHECK(web_contents_);
116 if (source == help_link_) { 116 if (source == help_link_) {
117 GURL help_url((kind_ == chrome::SAD_TAB_KIND_CRASHED) ? 117 GURL help_url((kind_ == chrome::SAD_TAB_KIND_CRASHED) ?
118 chrome::kCrashReasonURL : chrome::kKillReasonURL); 118 chrome::kCrashReasonURL : chrome::kKillReasonURL);
119 OpenURLParams params( 119 OpenURLParams params(
120 help_url, content::Referrer(), CURRENT_TAB, 120 help_url, content::Referrer(), CURRENT_TAB,
121 content::PAGE_TRANSITION_LINK, false); 121 content::PAGE_TRANSITION_LINK, false);
122 web_contents_->OpenURL(params); 122 web_contents_->OpenURL(params);
123 } else if (source == feedback_link_) { 123 } else if (source == feedback_link_) {
124 browser::ShowWebFeedbackView( 124 chrome::ShowFeedbackUI(
125 browser::FindBrowserWithWebContents(web_contents_), 125 browser::FindBrowserWithWebContents(web_contents_),
126 l10n_util::GetStringUTF8(IDS_KILLED_TAB_FEEDBACK_MESSAGE), 126 l10n_util::GetStringUTF8(IDS_KILLED_TAB_FEEDBACK_MESSAGE),
127 std::string(kCategoryTagCrash)); 127 std::string(kCategoryTagCrash));
128 } 128 }
129 } 129 }
130 130
131 void SadTabView::ButtonPressed(views::Button* source, 131 void SadTabView::ButtonPressed(views::Button* source,
132 const views::Event& event) { 132 const views::Event& event) {
133 DCHECK(web_contents_); 133 DCHECK(web_contents_);
134 DCHECK(source == reload_button_); 134 DCHECK(source == reload_button_);
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 } 263 }
264 264
265 views::Link* SadTabView::CreateLink(const string16& text) { 265 views::Link* SadTabView::CreateLink(const string16& text) {
266 views::Link* link = new views::Link(text); 266 views::Link* link = new views::Link(text);
267 link->SetFont(base_font_.DeriveFont(kMessageFontSizeDelta)); 267 link->SetFont(base_font_.DeriveFont(kMessageFontSizeDelta));
268 link->SetBackgroundColor(background()->get_color()); 268 link->SetBackgroundColor(background()->get_color());
269 link->SetEnabledColor(kTextColor); 269 link->SetEnabledColor(kTextColor);
270 link->set_listener(this); 270 link->set_listener(this);
271 return link; 271 return link;
272 } 272 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698