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

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

Issue 9562038: ui/gfx: Make gfx::Canvas inherit from gfx::CanvasSkia. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more fixes Created 8 years, 9 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/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 170
171 feedback_link_ = CreateLink( 171 feedback_link_ = CreateLink(
172 l10n_util::GetStringUTF16(IDS_KILLED_TAB_FEEDBACK_LINK)); 172 l10n_util::GetStringUTF16(IDS_KILLED_TAB_FEEDBACK_LINK));
173 layout->StartRowWithPadding(0, column_set_id, 0, kPadding); 173 layout->StartRowWithPadding(0, column_set_id, 0, kPadding);
174 layout->AddView(feedback_link_); 174 layout->AddView(feedback_link_);
175 } 175 }
176 } 176 }
177 layout->AddPaddingRow(1, kPadding); 177 layout->AddPaddingRow(1, kPadding);
178 } 178 }
179 179
180 void SadTabView::OnPaint(gfx::Canvas* canvas) { 180 void SadTabView::OnPaint(gfx::CanvasSkia* canvas) {
181 if (!painted_) { 181 if (!painted_) {
182 // User actually saw the error, keep track for user experience stats. 182 // User actually saw the error, keep track for user experience stats.
183 UMA_HISTOGRAM_COUNTS("SadTab.Displayed", kind_); 183 UMA_HISTOGRAM_COUNTS("SadTab.Displayed", kind_);
184 painted_ = true; 184 painted_ = true;
185 } 185 }
186 View::OnPaint(canvas); 186 View::OnPaint(canvas);
187 } 187 }
188 188
189 views::Label* SadTabView::CreateLabel(const string16& text) { 189 views::Label* SadTabView::CreateLabel(const string16& text) {
190 views::Label* label = new views::Label(text); 190 views::Label* label = new views::Label(text);
191 label->SetFont(base_font_.DeriveFont(kMessageFontSizeDelta)); 191 label->SetFont(base_font_.DeriveFont(kMessageFontSizeDelta));
192 label->SetBackgroundColor(background()->get_color()); 192 label->SetBackgroundColor(background()->get_color());
193 label->SetEnabledColor(kTextColor); 193 label->SetEnabledColor(kTextColor);
194 return label; 194 return label;
195 } 195 }
196 196
197 views::Link* SadTabView::CreateLink(const string16& text) { 197 views::Link* SadTabView::CreateLink(const string16& text) {
198 views::Link* link = new views::Link(text); 198 views::Link* link = new views::Link(text);
199 link->SetFont(base_font_.DeriveFont(kMessageFontSizeDelta)); 199 link->SetFont(base_font_.DeriveFont(kMessageFontSizeDelta));
200 link->SetBackgroundColor(background()->get_color()); 200 link->SetBackgroundColor(background()->get_color());
201 link->SetEnabledColor(kTextColor); 201 link->SetEnabledColor(kTextColor);
202 link->set_listener(this); 202 link->set_listener(this);
203 return link; 203 return link;
204 } 204 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698