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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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::FindBrowserForController(&web_contents_->GetController(), |
126 NULL), | 126 NULL), |
127 l10n_util::GetStringUTF8(IDS_KILLED_TAB_FEEDBACK_MESSAGE), | 127 l10n_util::GetStringUTF8(IDS_KILLED_TAB_FEEDBACK_MESSAGE), |
128 std::string(kCategoryTagCrash)); | 128 std::string(kCategoryTagCrash)); |
129 } | 129 } |
130 } | 130 } |
131 | 131 |
132 void SadTabView::ButtonPressed(views::Button* source, | 132 void SadTabView::ButtonPressed(views::Button* source, |
133 const views::Event& event) { | 133 const ui::Event& event) { |
134 DCHECK(web_contents_); | 134 DCHECK(web_contents_); |
135 DCHECK(source == reload_button_); | 135 DCHECK(source == reload_button_); |
136 web_contents_->GetController().Reload(true); | 136 web_contents_->GetController().Reload(true); |
137 } | 137 } |
138 | 138 |
139 void SadTabView::Layout() { | 139 void SadTabView::Layout() { |
140 // Specify the maximum message width explicitly. | 140 // Specify the maximum message width explicitly. |
141 message_->SizeToFit(static_cast<int>(width() * kMessageSize)); | 141 message_->SizeToFit(static_cast<int>(width() * kMessageSize)); |
142 View::Layout(); | 142 View::Layout(); |
143 } | 143 } |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 } | 264 } |
265 | 265 |
266 views::Link* SadTabView::CreateLink(const string16& text) { | 266 views::Link* SadTabView::CreateLink(const string16& text) { |
267 views::Link* link = new views::Link(text); | 267 views::Link* link = new views::Link(text); |
268 link->SetFont(base_font_.DeriveFont(kMessageFontSizeDelta)); | 268 link->SetFont(base_font_.DeriveFont(kMessageFontSizeDelta)); |
269 link->SetBackgroundColor(background()->get_color()); | 269 link->SetBackgroundColor(background()->get_color()); |
270 link->SetEnabledColor(kTextColor); | 270 link->SetEnabledColor(kTextColor); |
271 link->set_listener(this); | 271 link->set_listener(this); |
272 return link; | 272 return link; |
273 } | 273 } |
OLD | NEW |