OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/views/sad_tab_view.h" | 5 #include "chrome/browser/views/sad_tab_view.h" |
6 | 6 |
7 #include "base/gfx/size.h" | 7 #include "base/gfx/size.h" |
8 #include "chrome/app/theme/theme_resources.h" | 8 #include "chrome/app/theme/theme_resources.h" |
9 #include "chrome/common/gfx/chrome_canvas.h" | 9 #include "chrome/common/gfx/chrome_canvas.h" |
10 #include "chrome/common/l10n_util.h" | 10 #include "chrome/common/l10n_util.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 std::wstring SadTabView::title_; | 30 std::wstring SadTabView::title_; |
31 std::wstring SadTabView::message_; | 31 std::wstring SadTabView::message_; |
32 int SadTabView::title_width_; | 32 int SadTabView::title_width_; |
33 | 33 |
34 SadTabView::SadTabView() { | 34 SadTabView::SadTabView() { |
35 InitClass(); | 35 InitClass(); |
36 } | 36 } |
37 | 37 |
38 void SadTabView::Paint(ChromeCanvas* canvas) { | 38 void SadTabView::Paint(ChromeCanvas* canvas) { |
39 SkPaint paint; | 39 SkPaint paint; |
40 paint.setShader(gfx::CreateGradientShader(0, height(), | 40 paint.setShader(skia::CreateGradientShader(0, height(), |
41 kBackgroundColor, | 41 kBackgroundColor, |
42 kBackgroundEndColor))->safeUnref(); | 42 kBackgroundEndColor))->safeUnref(); |
43 paint.setStyle(SkPaint::kFill_Style); | 43 paint.setStyle(SkPaint::kFill_Style); |
44 canvas->drawRectCoords(0, 0, | 44 canvas->drawRectCoords(0, 0, |
45 SkIntToScalar(width()), SkIntToScalar(height()), | 45 SkIntToScalar(width()), SkIntToScalar(height()), |
46 paint); | 46 paint); |
47 | 47 |
48 canvas->DrawBitmapInt(*sad_tab_bitmap_, icon_bounds_.x(), icon_bounds_.y()); | 48 canvas->DrawBitmapInt(*sad_tab_bitmap_, icon_bounds_.x(), icon_bounds_.y()); |
49 | 49 |
50 canvas->DrawStringInt(title_, title_font_, kTitleColor, title_bounds_.x(), | 50 canvas->DrawStringInt(title_, title_font_, kTitleColor, title_bounds_.x(), |
51 title_bounds_.y(), title_bounds_.width(), | 51 title_bounds_.y(), title_bounds_.width(), |
52 title_bounds_.height(), | 52 title_bounds_.height(), |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 | 92 |
93 title_ = l10n_util::GetString(IDS_SAD_TAB_TITLE); | 93 title_ = l10n_util::GetString(IDS_SAD_TAB_TITLE); |
94 title_width_ = title_font_.GetStringWidth(title_); | 94 title_width_ = title_font_.GetStringWidth(title_); |
95 message_ = l10n_util::GetString(IDS_SAD_TAB_MESSAGE); | 95 message_ = l10n_util::GetString(IDS_SAD_TAB_MESSAGE); |
96 | 96 |
97 initialized = true; | 97 initialized = true; |
98 } | 98 } |
99 } | 99 } |
100 | 100 |
101 | 101 |
OLD | NEW |