OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
8 #include "chrome/browser/google/google_util.h" | 8 #include "chrome/browser/google/google_util.h" |
9 #include "chrome/common/url_constants.h" | 9 #include "chrome/common/url_constants.h" |
10 #include "content/browser/tab_contents/tab_contents.h" | 10 #include "content/browser/tab_contents/tab_contents.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 if (tab_contents != NULL) { | 63 if (tab_contents != NULL) { |
64 learn_more_link_ = | 64 learn_more_link_ = |
65 new views::Link(UTF16ToWide(l10n_util::GetStringUTF16(IDS_LEARN_MORE))); | 65 new views::Link(UTF16ToWide(l10n_util::GetStringUTF16(IDS_LEARN_MORE))); |
66 learn_more_link_->SetFont(*message_font_); | 66 learn_more_link_->SetFont(*message_font_); |
67 learn_more_link_->SetNormalColor(kLinkColor); | 67 learn_more_link_->SetNormalColor(kLinkColor); |
68 learn_more_link_->SetController(this); | 68 learn_more_link_->SetController(this); |
69 AddChildView(learn_more_link_); | 69 AddChildView(learn_more_link_); |
70 } | 70 } |
71 } | 71 } |
72 | 72 |
| 73 SadTabView::~SadTabView() {} |
| 74 |
73 void SadTabView::OnPaint(gfx::Canvas* canvas) { | 75 void SadTabView::OnPaint(gfx::Canvas* canvas) { |
74 SkPaint paint; | 76 SkPaint paint; |
75 SkSafeUnref(paint.setShader( | 77 SkSafeUnref(paint.setShader( |
76 gfx::CreateGradientShader( | 78 gfx::CreateGradientShader( |
77 0, | 79 0, |
78 height(), | 80 height(), |
79 kind_ == CRASHED ? kCrashBackgroundColor : kKillBackgroundColor, | 81 kind_ == CRASHED ? kCrashBackgroundColor : kKillBackgroundColor, |
80 kind_ == CRASHED ? | 82 kind_ == CRASHED ? |
81 kCrashBackgroundEndColor : kKillBackgroundEndColor))); | 83 kCrashBackgroundEndColor : kKillBackgroundEndColor))); |
82 paint.setStyle(SkPaint::kFill_Style); | 84 paint.setStyle(SkPaint::kFill_Style); |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 | 166 |
165 title_ = UTF16ToWide(l10n_util::GetStringUTF16( | 167 title_ = UTF16ToWide(l10n_util::GetStringUTF16( |
166 kind == CRASHED ? IDS_SAD_TAB_TITLE : IDS_KILLED_TAB_TITLE)); | 168 kind == CRASHED ? IDS_SAD_TAB_TITLE : IDS_KILLED_TAB_TITLE)); |
167 title_width_ = title_font_->GetStringWidth(WideToUTF16Hack(title_)); | 169 title_width_ = title_font_->GetStringWidth(WideToUTF16Hack(title_)); |
168 message_ = UTF16ToWide(l10n_util::GetStringUTF16( | 170 message_ = UTF16ToWide(l10n_util::GetStringUTF16( |
169 kind == CRASHED ? IDS_SAD_TAB_MESSAGE : IDS_KILLED_TAB_MESSAGE)); | 171 kind == CRASHED ? IDS_SAD_TAB_MESSAGE : IDS_KILLED_TAB_MESSAGE)); |
170 | 172 |
171 initialized = true; | 173 initialized = true; |
172 } | 174 } |
173 } | 175 } |
OLD | NEW |