Commit ade4397a authored by rohitrao@chromium.org's avatar rohitrao@chromium.org

Removes the ability to close or minimize the hung renderer dialog

on Mac.  I'm leaving the window resizable for now, because I dislike
non-resizable windows.  This is easy enough to change later.

BUG=None
TEST=After bringing up the dialog, verify that the only way to dismiss
it is by pressing either the wait button or the kill button.
Review URL: http://codereview.chromium.org/151009

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20044 0039d316-1c4b-4281-b951-d872f2087c98
parent f6c279fc
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
<string key="NSClassName">NSApplication</string> <string key="NSClassName">NSApplication</string>
</object> </object>
<object class="NSWindowTemplate" id="1005"> <object class="NSWindowTemplate" id="1005">
<int key="NSWindowStyleMask">15</int> <int key="NSWindowStyleMask">9</int>
<int key="NSWindowBacking">2</int> <int key="NSWindowBacking">2</int>
<string key="NSWindowRect">{{196, 264}, {480, 246}}</string> <string key="NSWindowRect">{{196, 264}, {480, 246}}</string>
<int key="NSWTFlags">536870912</int> <int key="NSWTFlags">536870912</int>
...@@ -564,9 +564,9 @@ ...@@ -564,9 +564,9 @@
<string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>{{445, 189}, {480, 246}}</string> <string>{{441, 138}, {480, 246}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>{{445, 189}, {480, 246}}</string> <string>{{441, 138}, {480, 246}}</string>
<reference ref="9"/> <reference ref="9"/>
<string>{196, 240}</string> <string>{196, 240}</string>
<string>{{357, 418}, {480, 270}}</string> <string>{{357, 418}, {480, 270}}</string>
...@@ -645,7 +645,7 @@ ...@@ -645,7 +645,7 @@
</object> </object>
<object class="IBClassDescriptionSource" key="sourceIdentifier"> <object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string> <string key="majorKey">IBProjectSource</string>
<string key="minorKey">browser/cocoa/hung_renderer_dialog_cocoa.h</string> <string key="minorKey">browser/cocoa/hung_renderer_controller.h</string>
</object> </object>
</object> </object>
<object class="IBPartialClassDescription"> <object class="IBPartialClassDescription">
......
...@@ -51,13 +51,15 @@ HungRendererController* g_instance = NULL; ...@@ -51,13 +51,15 @@ HungRendererController* g_instance = NULL;
if (hungContents_) if (hungContents_)
base::KillProcess(hungContents_->process()->process().handle(), base::KillProcess(hungContents_->process()->process().handle(),
ResultCodes::HUNG, false); ResultCodes::HUNG, false);
[[self window] performClose:nil]; // Cannot call performClose:, because the close button is disabled.
[self close];
} }
- (IBAction)wait:(id)sender { - (IBAction)wait:(id)sender {
if (hungContents_ && hungContents_->render_view_host()) if (hungContents_ && hungContents_->render_view_host())
hungContents_->render_view_host()->RestartHangMonitorTimeout(); hungContents_->render_view_host()->RestartHangMonitorTimeout();
[[self window] performClose:nil]; // Cannot call performClose:, because the close button is disabled.
[self close];
} }
- (int)numberOfRowsInTableView:(NSTableView *)aTableView { - (int)numberOfRowsInTableView:(NSTableView *)aTableView {
...@@ -103,13 +105,7 @@ HungRendererController* g_instance = NULL; ...@@ -103,13 +105,7 @@ HungRendererController* g_instance = NULL;
DCHECK(contents); DCHECK(contents);
DCHECK(hungContents_); DCHECK(hungContents_);
if (hungContents_ && hungContents_->process() == contents->process()) { if (hungContents_ && hungContents_->process() == contents->process()) {
// If you switch tabs with the dialog open, // Cannot call performClose:, because the close button is disabled.
// HungRendererDialog::EndForTabContents() is called after the
// RWHV is hidden. performClose: runs a nested message loop,
// during which the RWHV is drawn at least once, failing a DCHECK
// that ensures it is never drawn while hidden. The workaround
// here is to call close, which closes the window immediately with
// no nested message loop.
[self close]; [self close];
} }
} }
......
...@@ -28,7 +28,8 @@ TEST_F(HungRendererControllerTest, TestShowAndClose) { ...@@ -28,7 +28,8 @@ TEST_F(HungRendererControllerTest, TestShowAndClose) {
// Doesn't test much functionality-wise, but makes sure we can // Doesn't test much functionality-wise, but makes sure we can
// display and tear down a window. // display and tear down a window.
[hung_renderer_controller_ showWindow:nil]; [hung_renderer_controller_ showWindow:nil];
[[hung_renderer_controller_ window] performClose:nil]; // Cannot call performClose:, because the close button is disabled.
[hung_renderer_controller_ close];
} }
TEST_F(HungRendererControllerTest, TestKillButton) { TEST_F(HungRendererControllerTest, TestKillButton) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment