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

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

Issue 11148007: views: Fix a bunch of dchecks. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixes Created 8 years, 2 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"
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 browser::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* source, 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(source == reload_button_); 129 DCHECK_EQ(reload_button_, sender);
130 web_contents_->GetController().Reload(true); 130 web_contents_->GetController().Reload(true);
131 } 131 }
132 132
133 void SadTabView::Layout() { 133 void SadTabView::Layout() {
134 // Specify the maximum message width explicitly. 134 // Specify the maximum message width explicitly.
135 message_->SizeToFit(static_cast<int>(width() * kMessageSize)); 135 message_->SizeToFit(static_cast<int>(width() * kMessageSize));
136 View::Layout(); 136 View::Layout();
137 } 137 }
138 138
139 void SadTabView::ViewHierarchyChanged(bool is_add, 139 void SadTabView::ViewHierarchyChanged(bool is_add,
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698