summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrohitrao@chromium.org <rohitrao@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-07 17:46:49 +0000
committerrohitrao@chromium.org <rohitrao@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-07 17:46:49 +0000
commitade4397a3af8a2d4dd8dbc60af01b19ace85d5c9 (patch)
tree158c2634f5d30909ab34b72b87f8861cc2c7cfdd
parentf6c279fc27a38c65d590447297c9d5afcffaf2f3 (diff)
downloadchromium_src-ade4397a3af8a2d4dd8dbc60af01b19ace85d5c9.zip
chromium_src-ade4397a3af8a2d4dd8dbc60af01b19ace85d5c9.tar.gz
chromium_src-ade4397a3af8a2d4dd8dbc60af01b19ace85d5c9.tar.bz2
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
-rw-r--r--chrome/app/nibs/en.lproj/HungRendererDialog.xib8
-rw-r--r--chrome/browser/cocoa/hung_renderer_controller.mm14
-rw-r--r--chrome/browser/cocoa/hung_renderer_controller_unittest.mm3
3 files changed, 11 insertions, 14 deletions
diff --git a/chrome/app/nibs/en.lproj/HungRendererDialog.xib b/chrome/app/nibs/en.lproj/HungRendererDialog.xib
index 5b75f75..ec99929 100644
--- a/chrome/app/nibs/en.lproj/HungRendererDialog.xib
+++ b/chrome/app/nibs/en.lproj/HungRendererDialog.xib
@@ -35,7 +35,7 @@
<string key="NSClassName">NSApplication</string>
</object>
<object class="NSWindowTemplate" id="1005">
- <int key="NSWindowStyleMask">15</int>
+ <int key="NSWindowStyleMask">9</int>
<int key="NSWindowBacking">2</int>
<string key="NSWindowRect">{{196, 264}, {480, 246}}</string>
<int key="NSWTFlags">536870912</int>
@@ -564,9 +564,9 @@
<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>{{445, 189}, {480, 246}}</string>
+ <string>{{441, 138}, {480, 246}}</string>
<reference ref="9"/>
<string>{196, 240}</string>
<string>{{357, 418}, {480, 270}}</string>
@@ -645,7 +645,7 @@
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<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 class="IBPartialClassDescription">
diff --git a/chrome/browser/cocoa/hung_renderer_controller.mm b/chrome/browser/cocoa/hung_renderer_controller.mm
index a9ec7ea..0303f29 100644
--- a/chrome/browser/cocoa/hung_renderer_controller.mm
+++ b/chrome/browser/cocoa/hung_renderer_controller.mm
@@ -51,13 +51,15 @@ HungRendererController* g_instance = NULL;
if (hungContents_)
base::KillProcess(hungContents_->process()->process().handle(),
ResultCodes::HUNG, false);
- [[self window] performClose:nil];
+ // Cannot call performClose:, because the close button is disabled.
+ [self close];
}
- (IBAction)wait:(id)sender {
if (hungContents_ && hungContents_->render_view_host())
hungContents_->render_view_host()->RestartHangMonitorTimeout();
- [[self window] performClose:nil];
+ // Cannot call performClose:, because the close button is disabled.
+ [self close];
}
- (int)numberOfRowsInTableView:(NSTableView *)aTableView {
@@ -103,13 +105,7 @@ HungRendererController* g_instance = NULL;
DCHECK(contents);
DCHECK(hungContents_);
if (hungContents_ && hungContents_->process() == contents->process()) {
- // If you switch tabs with the dialog open,
- // 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.
+ // Cannot call performClose:, because the close button is disabled.
[self close];
}
}
diff --git a/chrome/browser/cocoa/hung_renderer_controller_unittest.mm b/chrome/browser/cocoa/hung_renderer_controller_unittest.mm
index 9b29d43..f658dd9 100644
--- a/chrome/browser/cocoa/hung_renderer_controller_unittest.mm
+++ b/chrome/browser/cocoa/hung_renderer_controller_unittest.mm
@@ -28,7 +28,8 @@ TEST_F(HungRendererControllerTest, TestShowAndClose) {
// Doesn't test much functionality-wise, but makes sure we can
// display and tear down a window.
[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) {