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/hung_renderer_dialog.h" | 5 #include "chrome/browser/hung_renderer_dialog.h" |
6 | 6 |
7 #include "base/i18n/rtl.h" | 7 #include "base/i18n/rtl.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "chrome/browser/browser_list.h" | 9 #include "chrome/browser/browser_list.h" |
10 #include "chrome/browser/renderer_host/render_process_host.h" | 10 #include "chrome/browser/renderer_host/render_process_host.h" |
11 #include "chrome/browser/renderer_host/render_view_host.h" | 11 #include "chrome/browser/renderer_host/render_view_host.h" |
12 #include "chrome/browser/tab_contents/tab_contents.h" | 12 #include "chrome/browser/tab_contents/tab_contents.h" |
| 13 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
13 #include "chrome/common/chrome_constants.h" | 14 #include "chrome/common/chrome_constants.h" |
14 #include "chrome/common/logging_chrome.h" | 15 #include "chrome/common/logging_chrome.h" |
15 #include "chrome/common/result_codes.h" | 16 #include "chrome/common/result_codes.h" |
16 #include "grit/chromium_strings.h" | 17 #include "grit/chromium_strings.h" |
17 #include "grit/generated_resources.h" | 18 #include "grit/generated_resources.h" |
18 #include "grit/theme_resources.h" | 19 #include "grit/theme_resources.h" |
19 #include "ui/base/l10n/l10n_util.h" | 20 #include "ui/base/l10n/l10n_util.h" |
20 #include "ui/base/resource/resource_bundle.h" | 21 #include "ui/base/resource/resource_bundle.h" |
21 #include "ui/gfx/canvas.h" | 22 #include "ui/gfx/canvas.h" |
22 #include "views/controls/button/native_button.h" | 23 #include "views/controls/button/native_button.h" |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 // HungPagesTableModel, views::GroupTableModel implementation: | 87 // HungPagesTableModel, views::GroupTableModel implementation: |
87 | 88 |
88 int HungPagesTableModel::RowCount() { | 89 int HungPagesTableModel::RowCount() { |
89 return static_cast<int>(tab_contentses_.size()); | 90 return static_cast<int>(tab_contentses_.size()); |
90 } | 91 } |
91 | 92 |
92 string16 HungPagesTableModel::GetText(int row, int column_id) { | 93 string16 HungPagesTableModel::GetText(int row, int column_id) { |
93 DCHECK(row >= 0 && row < RowCount()); | 94 DCHECK(row >= 0 && row < RowCount()); |
94 string16 title = tab_contentses_[row]->GetTitle(); | 95 string16 title = tab_contentses_[row]->GetTitle(); |
95 if (title.empty()) | 96 if (title.empty()) |
96 title = TabContents::GetDefaultTitle(); | 97 title = TabContentsWrapper::GetDefaultTitle(); |
97 // TODO(xji): Consider adding a special case if the title text is a URL, | 98 // TODO(xji): Consider adding a special case if the title text is a URL, |
98 // since those should always have LTR directionality. Please refer to | 99 // since those should always have LTR directionality. Please refer to |
99 // http://crbug.com/6726 for more information. | 100 // http://crbug.com/6726 for more information. |
100 base::i18n::AdjustStringForLocaleDirection(&title); | 101 base::i18n::AdjustStringForLocaleDirection(&title); |
101 return title; | 102 return title; |
102 } | 103 } |
103 | 104 |
104 SkBitmap HungPagesTableModel::GetIcon(int row) { | 105 SkBitmap HungPagesTableModel::GetIcon(int row) { |
105 DCHECK(row >= 0 && row < RowCount()); | 106 DCHECK(row >= 0 && row < RowCount()); |
106 return tab_contentses_.at(row)->GetFavIcon(); | 107 return tab_contentses_.at(row)->GetFavIcon(); |
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
461 } | 462 } |
462 | 463 |
463 // static | 464 // static |
464 void HideForTabContents(TabContents* contents) { | 465 void HideForTabContents(TabContents* contents) { |
465 if (!logging::DialogsAreSuppressed() && g_instance) | 466 if (!logging::DialogsAreSuppressed() && g_instance) |
466 g_instance->EndForTabContents(contents); | 467 g_instance->EndForTabContents(contents); |
467 } | 468 } |
468 | 469 |
469 } // namespace hung_renderer_dialog | 470 } // namespace hung_renderer_dialog |
470 | 471 |
OLD | NEW |