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 "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "app/resource_bundle.h" | 8 #include "app/resource_bundle.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "chrome/browser/google/google_util.h" | 10 #include "chrome/browser/google/google_util.h" |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 SkPaint paint; | 69 SkPaint paint; |
70 SkSafeUnref(paint.setShader(gfx::CreateGradientShader(0, height(), | 70 SkSafeUnref(paint.setShader(gfx::CreateGradientShader(0, height(), |
71 kBackgroundColor, | 71 kBackgroundColor, |
72 kBackgroundEndColor))); | 72 kBackgroundEndColor))); |
73 paint.setStyle(SkPaint::kFill_Style); | 73 paint.setStyle(SkPaint::kFill_Style); |
74 canvas->AsCanvasSkia()->drawRectCoords( | 74 canvas->AsCanvasSkia()->drawRectCoords( |
75 0, 0, SkIntToScalar(width()), SkIntToScalar(height()), paint); | 75 0, 0, SkIntToScalar(width()), SkIntToScalar(height()), paint); |
76 | 76 |
77 canvas->DrawBitmapInt(*sad_tab_bitmap_, icon_bounds_.x(), icon_bounds_.y()); | 77 canvas->DrawBitmapInt(*sad_tab_bitmap_, icon_bounds_.x(), icon_bounds_.y()); |
78 | 78 |
79 canvas->DrawStringInt(WideToUTF16Hack(title_), *title_font_, kTitleColor, | 79 canvas->DrawStringInt(title_, *title_font_, kTitleColor, title_bounds_.x(), |
80 title_bounds_.x(), title_bounds_.y(), | 80 title_bounds_.y(), title_bounds_.width(), |
81 title_bounds_.width(), title_bounds_.height(), | 81 title_bounds_.height(), |
82 gfx::Canvas::TEXT_ALIGN_CENTER); | 82 gfx::Canvas::TEXT_ALIGN_CENTER); |
83 | 83 |
84 canvas->DrawStringInt(WideToUTF16Hack(message_), *message_font_, | 84 canvas->DrawStringInt(message_, *message_font_, kMessageColor, |
85 kMessageColor, message_bounds_.x(), message_bounds_.y(), | 85 message_bounds_.x(), message_bounds_.y(), |
86 message_bounds_.width(), message_bounds_.height(), | 86 message_bounds_.width(), message_bounds_.height(), |
87 gfx::Canvas::MULTI_LINE); | 87 gfx::Canvas::MULTI_LINE); |
88 | 88 |
89 if (learn_more_link_ != NULL) | 89 if (learn_more_link_ != NULL) |
90 learn_more_link_->SetBounds(link_bounds_.x(), link_bounds_.y(), | 90 learn_more_link_->SetBounds(link_bounds_.x(), link_bounds_.y(), |
91 link_bounds_.width(), link_bounds_.height()); | 91 link_bounds_.width(), link_bounds_.height()); |
92 } | 92 } |
93 | 93 |
94 void SadTabView::Layout() { | 94 void SadTabView::Layout() { |
95 int icon_width = sad_tab_bitmap_->width(); | 95 int icon_width = sad_tab_bitmap_->width(); |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 rb.GetFont(ResourceBundle::BaseFont).DeriveFont(kMessageFontSizeDelta)); | 150 rb.GetFont(ResourceBundle::BaseFont).DeriveFont(kMessageFontSizeDelta)); |
151 sad_tab_bitmap_ = rb.GetBitmapNamed(IDR_SAD_TAB); | 151 sad_tab_bitmap_ = rb.GetBitmapNamed(IDR_SAD_TAB); |
152 | 152 |
153 title_ = UTF16ToWide(l10n_util::GetStringUTF16(IDS_SAD_TAB_TITLE)); | 153 title_ = UTF16ToWide(l10n_util::GetStringUTF16(IDS_SAD_TAB_TITLE)); |
154 title_width_ = title_font_->GetStringWidth(WideToUTF16Hack(title_)); | 154 title_width_ = title_font_->GetStringWidth(WideToUTF16Hack(title_)); |
155 message_ = UTF16ToWide(l10n_util::GetStringUTF16(IDS_SAD_TAB_MESSAGE)); | 155 message_ = UTF16ToWide(l10n_util::GetStringUTF16(IDS_SAD_TAB_MESSAGE)); |
156 | 156 |
157 initialized = true; | 157 initialized = true; |
158 } | 158 } |
159 } | 159 } |
OLD | NEW |