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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 chrome::ShowFeedbackPage( | 124 chrome::ShowFeedbackPage( |
125 browser::FindBrowserForController(&web_contents_->GetController(), | 125 browser::FindBrowserWithWebContents(web_contents_), |
126 NULL), | |
127 l10n_util::GetStringUTF8(IDS_KILLED_TAB_FEEDBACK_MESSAGE), | 126 l10n_util::GetStringUTF8(IDS_KILLED_TAB_FEEDBACK_MESSAGE), |
128 std::string(kCategoryTagCrash)); | 127 std::string(kCategoryTagCrash)); |
129 } | 128 } |
130 } | 129 } |
131 | 130 |
132 void SadTabView::ButtonPressed(views::Button* source, | 131 void SadTabView::ButtonPressed(views::Button* source, |
133 const ui::Event& event) { | 132 const ui::Event& event) { |
134 DCHECK(web_contents_); | 133 DCHECK(web_contents_); |
135 DCHECK(source == reload_button_); | 134 DCHECK(source == reload_button_); |
136 web_contents_->GetController().Reload(true); | 135 web_contents_->GetController().Reload(true); |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 } | 263 } |
265 | 264 |
266 views::Link* SadTabView::CreateLink(const string16& text) { | 265 views::Link* SadTabView::CreateLink(const string16& text) { |
267 views::Link* link = new views::Link(text); | 266 views::Link* link = new views::Link(text); |
268 link->SetFont(base_font_.DeriveFont(kMessageFontSizeDelta)); | 267 link->SetFont(base_font_.DeriveFont(kMessageFontSizeDelta)); |
269 link->SetBackgroundColor(background()->get_color()); | 268 link->SetBackgroundColor(background()->get_color()); |
270 link->SetEnabledColor(kTextColor); | 269 link->SetEnabledColor(kTextColor); |
271 link->set_listener(this); | 270 link->set_listener(this); |
272 return link; | 271 return link; |
273 } | 272 } |
OLD | NEW |