| 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" | |
| 9 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
| 10 #include "chrome/browser/google/google_util.h" | 9 #include "chrome/browser/google/google_util.h" |
| 11 #include "chrome/browser/tab_contents/tab_contents.h" | 10 #include "chrome/browser/tab_contents/tab_contents.h" |
| 12 #include "chrome/browser/tab_contents/tab_contents_delegate.h" | 11 #include "chrome/browser/tab_contents/tab_contents_delegate.h" |
| 13 #include "chrome/common/url_constants.h" | 12 #include "chrome/common/url_constants.h" |
| 14 #include "gfx/canvas.h" | 13 #include "gfx/canvas.h" |
| 15 #include "gfx/canvas_skia.h" | 14 #include "gfx/canvas_skia.h" |
| 16 #include "gfx/size.h" | 15 #include "gfx/size.h" |
| 17 #include "gfx/skia_util.h" | 16 #include "gfx/skia_util.h" |
| 18 #include "grit/generated_resources.h" | 17 #include "grit/generated_resources.h" |
| 19 #include "grit/locale_settings.h" | 18 #include "grit/locale_settings.h" |
| 20 #include "grit/theme_resources.h" | 19 #include "grit/theme_resources.h" |
| 21 #include "third_party/skia/include/effects/SkGradientShader.h" | 20 #include "third_party/skia/include/effects/SkGradientShader.h" |
| 21 #include "ui/base/resource/resource_bundle.h" |
| 22 | 22 |
| 23 static const int kSadTabOffset = -64; | 23 static const int kSadTabOffset = -64; |
| 24 static const int kIconTitleSpacing = 20; | 24 static const int kIconTitleSpacing = 20; |
| 25 static const int kTitleMessageSpacing = 15; | 25 static const int kTitleMessageSpacing = 15; |
| 26 static const int kMessageBottomMargin = 20; | 26 static const int kMessageBottomMargin = 20; |
| 27 static const float kMessageSize = 0.65f; | 27 static const float kMessageSize = 0.65f; |
| 28 static const SkColor kTitleColor = SK_ColorWHITE; | 28 static const SkColor kTitleColor = SK_ColorWHITE; |
| 29 static const SkColor kMessageColor = SK_ColorWHITE; | 29 static const SkColor kMessageColor = SK_ColorWHITE; |
| 30 static const SkColor kLinkColor = SK_ColorWHITE; | 30 static const SkColor kLinkColor = SK_ColorWHITE; |
| 31 static const SkColor kCrashBackgroundColor = SkColorSetRGB(35, 48, 64); | 31 static const SkColor kCrashBackgroundColor = SkColorSetRGB(35, 48, 64); |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 | 164 |
| 165 title_ = UTF16ToWide(l10n_util::GetStringUTF16( | 165 title_ = UTF16ToWide(l10n_util::GetStringUTF16( |
| 166 kind == CRASHED ? IDS_SAD_TAB_TITLE : IDS_KILLED_TAB_TITLE)); | 166 kind == CRASHED ? IDS_SAD_TAB_TITLE : IDS_KILLED_TAB_TITLE)); |
| 167 title_width_ = title_font_->GetStringWidth(WideToUTF16Hack(title_)); | 167 title_width_ = title_font_->GetStringWidth(WideToUTF16Hack(title_)); |
| 168 message_ = UTF16ToWide(l10n_util::GetStringUTF16( | 168 message_ = UTF16ToWide(l10n_util::GetStringUTF16( |
| 169 kind == CRASHED ? IDS_SAD_TAB_MESSAGE : IDS_KILLED_TAB_MESSAGE)); | 169 kind == CRASHED ? IDS_SAD_TAB_MESSAGE : IDS_KILLED_TAB_MESSAGE)); |
| 170 | 170 |
| 171 initialized = true; | 171 initialized = true; |
| 172 } | 172 } |
| 173 } | 173 } |
| OLD | NEW |