| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "app/gfx/canvas.h" | 7 #include "app/gfx/canvas.h" |
| 8 #include "app/l10n_util.h" | 8 #include "app/l10n_util.h" |
| 9 #include "app/resource_bundle.h" | 9 #include "app/resource_bundle.h" |
| 10 #include "base/i18n/rtl.h" |
| 10 #include "chrome/browser/browser_list.h" | 11 #include "chrome/browser/browser_list.h" |
| 11 #include "chrome/browser/renderer_host/render_process_host.h" | 12 #include "chrome/browser/renderer_host/render_process_host.h" |
| 12 #include "chrome/browser/renderer_host/render_view_host.h" | 13 #include "chrome/browser/renderer_host/render_view_host.h" |
| 13 #include "chrome/browser/tab_contents/tab_contents.h" | 14 #include "chrome/browser/tab_contents/tab_contents.h" |
| 14 #include "chrome/common/chrome_constants.h" | 15 #include "chrome/common/chrome_constants.h" |
| 15 #include "chrome/common/logging_chrome.h" | 16 #include "chrome/common/logging_chrome.h" |
| 16 #include "chrome/common/result_codes.h" | 17 #include "chrome/common/result_codes.h" |
| 17 #include "grit/chromium_strings.h" | 18 #include "grit/chromium_strings.h" |
| 18 #include "grit/generated_resources.h" | 19 #include "grit/generated_resources.h" |
| 19 #include "grit/theme_resources.h" | 20 #include "grit/theme_resources.h" |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 } | 89 } |
| 89 | 90 |
| 90 std::wstring HungPagesTableModel::GetText(int row, int column_id) { | 91 std::wstring HungPagesTableModel::GetText(int row, int column_id) { |
| 91 DCHECK(row >= 0 && row < RowCount()); | 92 DCHECK(row >= 0 && row < RowCount()); |
| 92 std::wstring title = UTF16ToWideHack(tab_contentses_[row]->GetTitle()); | 93 std::wstring title = UTF16ToWideHack(tab_contentses_[row]->GetTitle()); |
| 93 if (title.empty()) | 94 if (title.empty()) |
| 94 title = UTF16ToWideHack(TabContents::GetDefaultTitle()); | 95 title = UTF16ToWideHack(TabContents::GetDefaultTitle()); |
| 95 // TODO(xji): Consider adding a special case if the title text is a URL, | 96 // TODO(xji): Consider adding a special case if the title text is a URL, |
| 96 // since those should always have LTR directionality. Please refer to | 97 // since those should always have LTR directionality. Please refer to |
| 97 // http://crbug.com/6726 for more information. | 98 // http://crbug.com/6726 for more information. |
| 98 l10n_util::AdjustStringForLocaleDirection(title, &title); | 99 base::i18n::AdjustStringForLocaleDirection(title, &title); |
| 99 return title; | 100 return title; |
| 100 } | 101 } |
| 101 | 102 |
| 102 SkBitmap HungPagesTableModel::GetIcon(int row) { | 103 SkBitmap HungPagesTableModel::GetIcon(int row) { |
| 103 DCHECK(row >= 0 && row < RowCount()); | 104 DCHECK(row >= 0 && row < RowCount()); |
| 104 return tab_contentses_.at(row)->GetFavIcon(); | 105 return tab_contentses_.at(row)->GetFavIcon(); |
| 105 } | 106 } |
| 106 | 107 |
| 107 void HungPagesTableModel::SetObserver(TableModelObserver* observer) { | 108 void HungPagesTableModel::SetObserver(TableModelObserver* observer) { |
| 108 observer_ = observer; | 109 observer_ = observer; |
| (...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 451 } | 452 } |
| 452 | 453 |
| 453 // static | 454 // static |
| 454 void HideForTabContents(TabContents* contents) { | 455 void HideForTabContents(TabContents* contents) { |
| 455 if (!logging::DialogsAreSuppressed() && g_instance) | 456 if (!logging::DialogsAreSuppressed() && g_instance) |
| 456 g_instance->EndForTabContents(contents); | 457 g_instance->EndForTabContents(contents); |
| 457 } | 458 } |
| 458 | 459 |
| 459 } // namespace hung_renderer_dialog | 460 } // namespace hung_renderer_dialog |
| 460 | 461 |
| OLD | NEW |