| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 layout->AddView(title_, 2, 1); | 159 layout->AddView(title_, 2, 1); |
| 160 | 160 |
| 161 const SkColor text_color = GetNativeTheme()->GetSystemColor( | 161 const SkColor text_color = GetNativeTheme()->GetSystemColor( |
| 162 ui::NativeTheme::kColorId_LabelDisabledColor); | 162 ui::NativeTheme::kColorId_LabelDisabledColor); |
| 163 | 163 |
| 164 int message_id = IDS_SAD_TAB_MESSAGE; | 164 int message_id = IDS_SAD_TAB_MESSAGE; |
| 165 #if defined(OS_CHROMEOS) | 165 #if defined(OS_CHROMEOS) |
| 166 if (kind_ == chrome::SAD_TAB_KIND_KILLED_BY_OOM) | 166 if (kind_ == chrome::SAD_TAB_KIND_KILLED_BY_OOM) |
| 167 message_id = IDS_KILLED_TAB_BY_OOM_MESSAGE; | 167 message_id = IDS_KILLED_TAB_BY_OOM_MESSAGE; |
| 168 #endif | 168 #endif |
| 169 if (kind_ == chrome::SAD_TAB_OOM) |
| 170 message_id = IDS_SAD_TAB_OOM_MESSAGE; |
| 169 | 171 |
| 170 message_ = CreateLabel(l10n_util::GetStringUTF16(message_id)); | 172 message_ = CreateLabel(l10n_util::GetStringUTF16(message_id)); |
| 171 | 173 |
| 172 message_->SetMultiLine(true); | 174 message_->SetMultiLine(true); |
| 173 message_->SetEnabledColor(text_color); | 175 message_->SetEnabledColor(text_color); |
| 174 message_->SetHorizontalAlignment(gfx::ALIGN_LEFT); | 176 message_->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
| 175 message_->SetLineHeight(views::kPanelSubVerticalSpacing); | 177 message_->SetLineHeight(views::kPanelSubVerticalSpacing); |
| 176 | 178 |
| 177 layout->StartRowWithPadding(0, column_set_id, 0, views::kPanelVertMargin); | 179 layout->StartRowWithPadding(0, column_set_id, 0, views::kPanelVertMargin); |
| 178 layout->AddView(message_, 2, 1, views::GridLayout::LEADING, | 180 layout->AddView(message_, 2, 1, views::GridLayout::LEADING, |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 309 } | 311 } |
| 310 | 312 |
| 311 namespace chrome { | 313 namespace chrome { |
| 312 | 314 |
| 313 SadTab* SadTab::Create(content::WebContents* web_contents, | 315 SadTab* SadTab::Create(content::WebContents* web_contents, |
| 314 SadTabKind kind) { | 316 SadTabKind kind) { |
| 315 return new SadTabView(web_contents, kind); | 317 return new SadTabView(web_contents, kind); |
| 316 } | 318 } |
| 317 | 319 |
| 318 } // namespace chrome | 320 } // namespace chrome |
| OLD | NEW |