| 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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 return tab_observers_.empty() ? NULL : | 147 return tab_observers_.empty() ? NULL : |
| 148 tab_observers_[0]->web_contents()->GetRenderProcessHost(); | 148 tab_observers_[0]->web_contents()->GetRenderProcessHost(); |
| 149 } | 149 } |
| 150 | 150 |
| 151 RenderViewHost* HungPagesTableModel::GetRenderViewHost() { | 151 RenderViewHost* HungPagesTableModel::GetRenderViewHost() { |
| 152 return tab_observers_.empty() ? NULL : | 152 return tab_observers_.empty() ? NULL : |
| 153 tab_observers_[0]->web_contents()->GetRenderViewHost(); | 153 tab_observers_[0]->web_contents()->GetRenderViewHost(); |
| 154 } | 154 } |
| 155 | 155 |
| 156 void HungPagesTableModel::InitForWebContents(WebContents* hung_contents) { | 156 void HungPagesTableModel::InitForWebContents(WebContents* hung_contents) { |
| 157 tab_observers_.reset(); | 157 tab_observers_.clear(); |
| 158 if (hung_contents) { | 158 if (hung_contents) { |
| 159 // Force hung_contents to be first. | 159 // Force hung_contents to be first. |
| 160 TabContents* hung_tab_contents = | 160 TabContents* hung_tab_contents = |
| 161 TabContents::FromWebContents(hung_contents); | 161 TabContents::FromWebContents(hung_contents); |
| 162 if (hung_tab_contents) { | 162 if (hung_tab_contents) { |
| 163 tab_observers_.push_back(new WebContentsObserverImpl(this, | 163 tab_observers_.push_back(new WebContentsObserverImpl(this, |
| 164 hung_tab_contents)); | 164 hung_tab_contents)); |
| 165 } | 165 } |
| 166 for (TabContentsIterator it; !it.done(); ++it) { | 166 for (TabContentsIterator it; !it.done(); ++it) { |
| 167 if (*it != hung_tab_contents && | 167 if (*it != hung_tab_contents && |
| (...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 589 g_instance->ShowForWebContents(contents); | 589 g_instance->ShowForWebContents(contents); |
| 590 } | 590 } |
| 591 } | 591 } |
| 592 | 592 |
| 593 void HideHungRendererDialog(WebContents* contents) { | 593 void HideHungRendererDialog(WebContents* contents) { |
| 594 if (!logging::DialogsAreSuppressed() && g_instance) | 594 if (!logging::DialogsAreSuppressed() && g_instance) |
| 595 g_instance->EndForWebContents(contents); | 595 g_instance->EndForWebContents(contents); |
| 596 } | 596 } |
| 597 | 597 |
| 598 } // namespace chrome | 598 } // namespace chrome |
| OLD | NEW |