Index: chrome/browser/ui/views/hung_renderer_view.cc |
=================================================================== |
--- chrome/browser/ui/views/hung_renderer_view.cc (revision 147919) |
+++ chrome/browser/ui/views/hung_renderer_view.cc (working copy) |
@@ -39,10 +39,6 @@ |
#include "ui/aura/window.h" |
#endif |
-#if defined(OS_WIN) |
-#include "chrome/browser/hang_monitor/hang_crash_dump_win.h" |
-#endif |
- |
HungRendererDialogView* HungRendererDialogView::g_instance_ = NULL; |
/////////////////////////////////////////////////////////////////////////////// |
@@ -208,7 +204,8 @@ |
// Don't show the warning unless the foreground window is the frame, or this |
// window (but still invisible). If the user has another window or |
// application selected, activating ourselves is rude. |
- if (!IsFrameActive(contents)) |
+ if (!IsFrameActive(contents) && |
+ !platform_util::IsWindowActive(GetWidget()->GetNativeWindow())) |
return; |
if (!GetWidget()->IsActive()) { |
@@ -306,13 +303,7 @@ |
base::ProcessHandle process_handle = |
hung_pages_table_model_->GetRenderProcessHost()->GetHandle(); |
-#if defined(OS_WIN) |
- // Try to generate a crash report for the hung process. |
- CrashDumpAndTerminateHungChildProcess(process_handle); |
-#else |
- // Kill the process. |
- base::KillProcess(process_handle, content::RESULT_CODE_HUNG, false); |
-#endif |
+ KillRendererProcess(process_handle); |
} |
} |
@@ -336,11 +327,7 @@ |
bool HungRendererDialogView::IsFrameActive(WebContents* contents) { |
gfx::NativeView frame_view = |
platform_util::GetTopLevel(contents->GetNativeView()); |
- if (!platform_util::IsWindowActive(frame_view) && |
- !platform_util::IsWindowActive(GetWidget()->GetNativeWindow())) { |
- return false; |
- } |
- return true; |
+ return platform_util::IsWindowActive(frame_view); |
} |
/////////////////////////////////////////////////////////////////////////////// |
@@ -449,6 +436,14 @@ |
} |
} |
+#if !defined(OS_WIN) |
+// static |
+void HungRendererDialogView::KillRendererProcess( |
+ base::ProcessHandle process_handle) { |
+ base::KillProcess(process_handle, content::RESULT_CODE_HUNG, false); |
+} |
+#endif // OS_WIN |
+ |
namespace chrome { |
void ShowHungRendererDialog(WebContents* contents) { |