OLD | NEW |
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" |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 DCHECK(web_contents_); | 110 DCHECK(web_contents_); |
111 if (source == help_link_) { | 111 if (source == help_link_) { |
112 GURL help_url((kind_ == chrome::SAD_TAB_KIND_CRASHED) ? | 112 GURL help_url((kind_ == chrome::SAD_TAB_KIND_CRASHED) ? |
113 chrome::kCrashReasonURL : chrome::kKillReasonURL); | 113 chrome::kCrashReasonURL : chrome::kKillReasonURL); |
114 OpenURLParams params( | 114 OpenURLParams params( |
115 help_url, content::Referrer(), CURRENT_TAB, | 115 help_url, content::Referrer(), CURRENT_TAB, |
116 content::PAGE_TRANSITION_LINK, false); | 116 content::PAGE_TRANSITION_LINK, false); |
117 web_contents_->OpenURL(params); | 117 web_contents_->OpenURL(params); |
118 } else if (source == feedback_link_) { | 118 } else if (source == feedback_link_) { |
119 chrome::ShowFeedbackPage( | 119 chrome::ShowFeedbackPage( |
120 browser::FindBrowserWithWebContents(web_contents_), | 120 chrome::FindBrowserWithWebContents(web_contents_), |
121 l10n_util::GetStringUTF8(IDS_KILLED_TAB_FEEDBACK_MESSAGE), | 121 l10n_util::GetStringUTF8(IDS_KILLED_TAB_FEEDBACK_MESSAGE), |
122 std::string(kCategoryTagCrash)); | 122 std::string(kCategoryTagCrash)); |
123 } | 123 } |
124 } | 124 } |
125 | 125 |
126 void SadTabView::ButtonPressed(views::Button* sender, | 126 void SadTabView::ButtonPressed(views::Button* sender, |
127 const ui::Event& event) { | 127 const ui::Event& event) { |
128 DCHECK(web_contents_); | 128 DCHECK(web_contents_); |
129 DCHECK_EQ(reload_button_, sender); | 129 DCHECK_EQ(reload_button_, sender); |
130 web_contents_->GetController().Reload(true); | 130 web_contents_->GetController().Reload(true); |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 } | 258 } |
259 | 259 |
260 views::Link* SadTabView::CreateLink(const string16& text) { | 260 views::Link* SadTabView::CreateLink(const string16& text) { |
261 views::Link* link = new views::Link(text); | 261 views::Link* link = new views::Link(text); |
262 link->SetFont(base_font_.DeriveFont(kMessageFontSizeDelta)); | 262 link->SetFont(base_font_.DeriveFont(kMessageFontSizeDelta)); |
263 link->SetBackgroundColor(background()->get_color()); | 263 link->SetBackgroundColor(background()->get_color()); |
264 link->SetEnabledColor(kTextColor); | 264 link->SetEnabledColor(kTextColor); |
265 link->set_listener(this); | 265 link->set_listener(this); |
266 return link; | 266 return link; |
267 } | 267 } |
OLD | NEW |