OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/gtk/sad_tab_gtk.h" | 5 #include "chrome/browser/gtk/sad_tab_gtk.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "app/gfx/chrome_canvas.h" | 9 #include "app/gfx/chrome_canvas.h" |
10 #include "app/gfx/chrome_font.h" | 10 #include "app/gfx/chrome_font.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 const SkColor kMessageTextColor = SK_ColorWHITE; | 29 const SkColor kMessageTextColor = SK_ColorWHITE; |
30 const SkColor kBackgroundColor = SkColorSetRGB(35, 48, 64); | 30 const SkColor kBackgroundColor = SkColorSetRGB(35, 48, 64); |
31 const SkColor kBackgroundEndColor = SkColorSetRGB(35, 48, 64); | 31 const SkColor kBackgroundEndColor = SkColorSetRGB(35, 48, 64); |
32 | 32 |
33 struct SadTabGtkConstants { | 33 struct SadTabGtkConstants { |
34 SadTabGtkConstants() | 34 SadTabGtkConstants() |
35 : sad_tab_bitmap( | 35 : sad_tab_bitmap( |
36 ResourceBundle::GetSharedInstance().GetBitmapNamed(IDR_SAD_TAB)), | 36 ResourceBundle::GetSharedInstance().GetBitmapNamed(IDR_SAD_TAB)), |
37 title_font( | 37 title_font( |
38 ResourceBundle::GetSharedInstance().GetFont( | 38 ResourceBundle::GetSharedInstance().GetFont( |
39 ResourceBundle::BaseFont).DeriveFont(2, ChromeFont::BOLD)), | 39 ResourceBundle::BaseFont).DeriveFont(2, gfx::Font::BOLD)), |
40 message_font( | 40 message_font( |
41 ResourceBundle::GetSharedInstance().GetFont( | 41 ResourceBundle::GetSharedInstance().GetFont( |
42 ResourceBundle::BaseFont).DeriveFont(1)), | 42 ResourceBundle::BaseFont).DeriveFont(1)), |
43 title(l10n_util::GetString(IDS_SAD_TAB_TITLE)), | 43 title(l10n_util::GetString(IDS_SAD_TAB_TITLE)), |
44 message(l10n_util::GetString(IDS_SAD_TAB_MESSAGE)) {} | 44 message(l10n_util::GetString(IDS_SAD_TAB_MESSAGE)) {} |
45 | 45 |
46 const SkBitmap* sad_tab_bitmap; | 46 const SkBitmap* sad_tab_bitmap; |
47 ChromeFont title_font; | 47 gfx::Font title_font; |
48 ChromeFont message_font; | 48 gfx::Font message_font; |
49 std::wstring title; | 49 std::wstring title; |
50 std::wstring message; | 50 std::wstring message; |
51 }; | 51 }; |
52 | 52 |
53 base::LazyInstance<SadTabGtkConstants> | 53 base::LazyInstance<SadTabGtkConstants> |
54 g_sad_tab_constants(base::LINKER_INITIALIZED); | 54 g_sad_tab_constants(base::LINKER_INITIALIZED); |
55 | 55 |
56 } // namespace | 56 } // namespace |
57 | 57 |
58 SadTabGtk::SadTabGtk() | 58 SadTabGtk::SadTabGtk() |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 int icon_y = ((event->height - icon_height) / 2) + kSadTabOffset; | 143 int icon_y = ((event->height - icon_height) / 2) + kSadTabOffset; |
144 icon_bounds_.SetRect(icon_x, icon_y, icon_width, icon_height); | 144 icon_bounds_.SetRect(icon_x, icon_y, icon_width, icon_height); |
145 | 145 |
146 title_y_ = | 146 title_y_ = |
147 icon_bounds_.bottom() + kIconTitleSpacing; | 147 icon_bounds_.bottom() + kIconTitleSpacing; |
148 int title_height = sad_tab_constants.title_font.height(); | 148 int title_height = sad_tab_constants.title_font.height(); |
149 message_y_ = | 149 message_y_ = |
150 title_y_ + title_height + kTitleMessageSpacing; | 150 title_y_ + title_height + kTitleMessageSpacing; |
151 return TRUE; | 151 return TRUE; |
152 } | 152 } |
OLD | NEW |