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/ui/browser_dialogs.h" | 5 #include "chrome/browser/ui/browser_dialogs.h" |
6 | 6 |
7 #include "base/i18n/rtl.h" | 7 #include "base/i18n/rtl.h" |
8 #include "base/memory/scoped_vector.h" | 8 #include "base/memory/scoped_vector.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "chrome/browser/favicon/favicon_tab_helper.h" | 10 #include "chrome/browser/favicon/favicon_tab_helper.h" |
11 #include "chrome/browser/ui/browser_list.h" | 11 #include "chrome/browser/ui/browser_list.h" |
12 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 12 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
13 #include "chrome/common/chrome_constants.h" | 13 #include "chrome/common/chrome_constants.h" |
14 #include "chrome/common/logging_chrome.h" | 14 #include "chrome/common/logging_chrome.h" |
15 #include "content/browser/renderer_host/render_process_host.h" | |
16 #include "content/browser/renderer_host/render_view_host.h" | 15 #include "content/browser/renderer_host/render_view_host.h" |
17 #include "content/browser/tab_contents/tab_contents.h" | 16 #include "content/browser/tab_contents/tab_contents.h" |
| 17 #include "content/public/browser/render_process_host.h" |
18 #include "content/public/common/result_codes.h" | 18 #include "content/public/common/result_codes.h" |
19 #include "grit/chromium_strings.h" | 19 #include "grit/chromium_strings.h" |
20 #include "grit/generated_resources.h" | 20 #include "grit/generated_resources.h" |
21 #include "grit/theme_resources.h" | 21 #include "grit/theme_resources.h" |
22 #include "ui/base/l10n/l10n_util.h" | 22 #include "ui/base/l10n/l10n_util.h" |
23 #include "ui/base/resource/resource_bundle.h" | 23 #include "ui/base/resource/resource_bundle.h" |
24 #include "ui/gfx/canvas.h" | 24 #include "ui/gfx/canvas.h" |
25 #include "ui/views/window/client_view.h" | 25 #include "ui/views/window/client_view.h" |
26 #include "ui/views/window/dialog_delegate.h" | 26 #include "ui/views/window/dialog_delegate.h" |
27 #include "views/controls/button/text_button.h" | 27 #include "views/controls/button/text_button.h" |
(...skipping 26 matching lines...) Expand all Loading... |
54 virtual ~Delegate() {} | 54 virtual ~Delegate() {} |
55 }; | 55 }; |
56 | 56 |
57 explicit HungPagesTableModel(Delegate* delegate); | 57 explicit HungPagesTableModel(Delegate* delegate); |
58 virtual ~HungPagesTableModel(); | 58 virtual ~HungPagesTableModel(); |
59 | 59 |
60 void InitForTabContents(TabContents* hung_contents); | 60 void InitForTabContents(TabContents* hung_contents); |
61 | 61 |
62 // Returns the first RenderProcessHost, or NULL if there aren't any | 62 // Returns the first RenderProcessHost, or NULL if there aren't any |
63 // TabContents. | 63 // TabContents. |
64 RenderProcessHost* GetRenderProcessHost(); | 64 content::RenderProcessHost* GetRenderProcessHost(); |
65 | 65 |
66 // Returns the first RenderViewHost, or NULL if there aren't any TabContents. | 66 // Returns the first RenderViewHost, or NULL if there aren't any TabContents. |
67 RenderViewHost* GetRenderViewHost(); | 67 RenderViewHost* GetRenderViewHost(); |
68 | 68 |
69 // Overridden from views::GroupTableModel: | 69 // Overridden from views::GroupTableModel: |
70 virtual int RowCount(); | 70 virtual int RowCount(); |
71 virtual string16 GetText(int row, int column_id); | 71 virtual string16 GetText(int row, int column_id); |
72 virtual SkBitmap GetIcon(int row); | 72 virtual SkBitmap GetIcon(int row); |
73 virtual void SetObserver(ui::TableModelObserver* observer); | 73 virtual void SetObserver(ui::TableModelObserver* observer); |
74 virtual void GetGroupRangeForItem(int item, views::GroupRange* range); | 74 virtual void GetGroupRangeForItem(int item, views::GroupRange* range); |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 // HungPagesTableModel, public: | 117 // HungPagesTableModel, public: |
118 | 118 |
119 HungPagesTableModel::HungPagesTableModel(Delegate* delegate) | 119 HungPagesTableModel::HungPagesTableModel(Delegate* delegate) |
120 : observer_(NULL), | 120 : observer_(NULL), |
121 delegate_(delegate) { | 121 delegate_(delegate) { |
122 } | 122 } |
123 | 123 |
124 HungPagesTableModel::~HungPagesTableModel() { | 124 HungPagesTableModel::~HungPagesTableModel() { |
125 } | 125 } |
126 | 126 |
127 RenderProcessHost* HungPagesTableModel::GetRenderProcessHost() { | 127 content::RenderProcessHost* HungPagesTableModel::GetRenderProcessHost() { |
128 return tab_observers_.empty() ? NULL : | 128 return tab_observers_.empty() ? NULL : |
129 tab_observers_[0]->tab_contents()->GetRenderProcessHost(); | 129 tab_observers_[0]->tab_contents()->GetRenderProcessHost(); |
130 } | 130 } |
131 | 131 |
132 RenderViewHost* HungPagesTableModel::GetRenderViewHost() { | 132 RenderViewHost* HungPagesTableModel::GetRenderViewHost() { |
133 return tab_observers_.empty() ? NULL : | 133 return tab_observers_.empty() ? NULL : |
134 tab_observers_[0]->tab_contents()->render_view_host(); | 134 tab_observers_[0]->tab_contents()->render_view_host(); |
135 } | 135 } |
136 | 136 |
137 void HungPagesTableModel::InitForTabContents(TabContents* hung_contents) { | 137 void HungPagesTableModel::InitForTabContents(TabContents* hung_contents) { |
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
559 g_instance->ShowForTabContents(contents); | 559 g_instance->ShowForTabContents(contents); |
560 } | 560 } |
561 } | 561 } |
562 | 562 |
563 void HideNativeHungRendererDialog(TabContents* contents) { | 563 void HideNativeHungRendererDialog(TabContents* contents) { |
564 if (!logging::DialogsAreSuppressed() && g_instance) | 564 if (!logging::DialogsAreSuppressed() && g_instance) |
565 g_instance->EndForTabContents(contents); | 565 g_instance->EndForTabContents(contents); |
566 } | 566 } |
567 | 567 |
568 } // namespace browser | 568 } // namespace browser |
OLD | NEW |