| 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/browser_dialogs.h" | 5 #include "chrome/browser/ui/browser_dialogs.h" |
| 6 | 6 |
| 7 #if defined(OS_WIN) && !defined(USE_AURA) | 7 #if defined(OS_WIN) && !defined(USE_AURA) |
| 8 #include <windows.h> | 8 #include <windows.h> |
| 9 #endif | 9 #endif |
| 10 | 10 |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 // Returns the first RenderProcessHost, or NULL if there aren't any | 77 // Returns the first RenderProcessHost, or NULL if there aren't any |
| 78 // WebContents. | 78 // WebContents. |
| 79 content::RenderProcessHost* GetRenderProcessHost(); | 79 content::RenderProcessHost* GetRenderProcessHost(); |
| 80 | 80 |
| 81 // Returns the first RenderViewHost, or NULL if there aren't any WebContents. | 81 // Returns the first RenderViewHost, or NULL if there aren't any WebContents. |
| 82 RenderViewHost* GetRenderViewHost(); | 82 RenderViewHost* GetRenderViewHost(); |
| 83 | 83 |
| 84 // Overridden from views::GroupTableModel: | 84 // Overridden from views::GroupTableModel: |
| 85 virtual int RowCount(); | 85 virtual int RowCount(); |
| 86 virtual string16 GetText(int row, int column_id); | 86 virtual string16 GetText(int row, int column_id); |
| 87 virtual SkBitmap GetIcon(int row); | 87 virtual gfx::ImageSkia GetIcon(int row); |
| 88 virtual void SetObserver(ui::TableModelObserver* observer); | 88 virtual void SetObserver(ui::TableModelObserver* observer); |
| 89 virtual void GetGroupRangeForItem(int item, views::GroupRange* range); | 89 virtual void GetGroupRangeForItem(int item, views::GroupRange* range); |
| 90 | 90 |
| 91 private: | 91 private: |
| 92 // Used to track a single WebContents. If the WebContents is destroyed | 92 // Used to track a single WebContents. If the WebContents is destroyed |
| 93 // TabDestroyed() is invoked on the model. | 93 // TabDestroyed() is invoked on the model. |
| 94 class WebContentsObserverImpl : public content::WebContentsObserver { | 94 class WebContentsObserverImpl : public content::WebContentsObserver { |
| 95 public: | 95 public: |
| 96 WebContentsObserverImpl(HungPagesTableModel* model, | 96 WebContentsObserverImpl(HungPagesTableModel* model, |
| 97 TabContentsWrapper* tab); | 97 TabContentsWrapper* tab); |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 string16 title = tab_observers_[row]->web_contents()->GetTitle(); | 181 string16 title = tab_observers_[row]->web_contents()->GetTitle(); |
| 182 if (title.empty()) | 182 if (title.empty()) |
| 183 title = CoreTabHelper::GetDefaultTitle(); | 183 title = CoreTabHelper::GetDefaultTitle(); |
| 184 // TODO(xji): Consider adding a special case if the title text is a URL, | 184 // TODO(xji): Consider adding a special case if the title text is a URL, |
| 185 // since those should always have LTR directionality. Please refer to | 185 // since those should always have LTR directionality. Please refer to |
| 186 // http://crbug.com/6726 for more information. | 186 // http://crbug.com/6726 for more information. |
| 187 base::i18n::AdjustStringForLocaleDirection(&title); | 187 base::i18n::AdjustStringForLocaleDirection(&title); |
| 188 return title; | 188 return title; |
| 189 } | 189 } |
| 190 | 190 |
| 191 SkBitmap HungPagesTableModel::GetIcon(int row) { | 191 gfx::ImageSkia HungPagesTableModel::GetIcon(int row) { |
| 192 DCHECK(row >= 0 && row < RowCount()); | 192 DCHECK(row >= 0 && row < RowCount()); |
| 193 return tab_observers_[row]->favicon_tab_helper()->GetFavicon(); | 193 return tab_observers_[row]->favicon_tab_helper()->GetFavicon(); |
| 194 } | 194 } |
| 195 | 195 |
| 196 void HungPagesTableModel::SetObserver(ui::TableModelObserver* observer) { | 196 void HungPagesTableModel::SetObserver(ui::TableModelObserver* observer) { |
| 197 observer_ = observer; | 197 observer_ = observer; |
| 198 } | 198 } |
| 199 | 199 |
| 200 void HungPagesTableModel::GetGroupRangeForItem(int item, | 200 void HungPagesTableModel::GetGroupRangeForItem(int item, |
| 201 views::GroupRange* range) { | 201 views::GroupRange* range) { |
| (...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 576 g_instance->ShowForWebContents(contents); | 576 g_instance->ShowForWebContents(contents); |
| 577 } | 577 } |
| 578 } | 578 } |
| 579 | 579 |
| 580 void HideHungRendererDialog(WebContents* contents) { | 580 void HideHungRendererDialog(WebContents* contents) { |
| 581 if (!logging::DialogsAreSuppressed() && g_instance) | 581 if (!logging::DialogsAreSuppressed() && g_instance) |
| 582 g_instance->EndForWebContents(contents); | 582 g_instance->EndForWebContents(contents); |
| 583 } | 583 } |
| 584 | 584 |
| 585 } // namespace browser | 585 } // namespace browser |
| OLD | NEW |