| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/views/hung_renderer_view.h" | 5 #include "chrome/browser/views/hung_renderer_view.h" |
| 6 | 6 |
| 7 #include "chrome/app/result_codes.h" | 7 #include "chrome/app/result_codes.h" |
| 8 #include "chrome/app/theme/theme_resources.h" | 8 #include "chrome/app/theme/theme_resources.h" |
| 9 #include "chrome/browser/browser_list.h" | 9 #include "chrome/browser/browser_list.h" |
| 10 #include "chrome/browser/renderer_host/render_view_host.h" | 10 #include "chrome/browser/renderer_host/render_view_host.h" |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 | 78 |
| 79 int HungPagesTableModel::RowCount() { | 79 int HungPagesTableModel::RowCount() { |
| 80 return static_cast<int>(webcontentses_.size()); | 80 return static_cast<int>(webcontentses_.size()); |
| 81 } | 81 } |
| 82 | 82 |
| 83 std::wstring HungPagesTableModel::GetText(int row, int column_id) { | 83 std::wstring HungPagesTableModel::GetText(int row, int column_id) { |
| 84 DCHECK(row >= 0 && row < RowCount()); | 84 DCHECK(row >= 0 && row < RowCount()); |
| 85 std::wstring title = webcontentses_.at(row)->GetTitle(); | 85 std::wstring title = webcontentses_.at(row)->GetTitle(); |
| 86 if (title.empty()) | 86 if (title.empty()) |
| 87 title = l10n_util::GetString(IDS_TAB_UNTITLED_TITLE); | 87 title = l10n_util::GetString(IDS_TAB_UNTITLED_TITLE); |
| 88 // TODO(xji): Consider adding a special case if the title text is a URL, |
| 89 // since those should always have LTR directionality. Please refer to |
| 90 // http://crbug.com/6726 for more information. |
| 91 l10n_util::AdjustStringForLocaleDirection(title, &title); |
| 88 return title; | 92 return title; |
| 89 } | 93 } |
| 90 | 94 |
| 91 SkBitmap HungPagesTableModel::GetIcon(int row) { | 95 SkBitmap HungPagesTableModel::GetIcon(int row) { |
| 92 DCHECK(row >= 0 && row < RowCount()); | 96 DCHECK(row >= 0 && row < RowCount()); |
| 93 return webcontentses_.at(row)->GetFavIcon(); | 97 return webcontentses_.at(row)->GetFavIcon(); |
| 94 } | 98 } |
| 95 | 99 |
| 96 void HungPagesTableModel::SetObserver(views::TableModelObserver* observer) { | 100 void HungPagesTableModel::SetObserver(views::TableModelObserver* observer) { |
| 97 observer_ = observer; | 101 observer_ = observer; |
| (...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 439 instance_->ShowForWebContents(contents); | 443 instance_->ShowForWebContents(contents); |
| 440 } | 444 } |
| 441 } | 445 } |
| 442 | 446 |
| 443 // static | 447 // static |
| 444 void HungRendererWarning::HideForWebContents(WebContents* contents) { | 448 void HungRendererWarning::HideForWebContents(WebContents* contents) { |
| 445 if (!logging::DialogsAreSuppressed() && instance_) | 449 if (!logging::DialogsAreSuppressed() && instance_) |
| 446 instance_->EndForWebContents(contents); | 450 instance_->EndForWebContents(contents); |
| 447 } | 451 } |
| 448 | 452 |
| OLD | NEW |