| 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 #import "chrome/browser/ui/cocoa/hung_renderer_controller.h" | 5 #import "chrome/browser/ui/cocoa/hung_renderer_controller.h" |
| 6 | 6 |
| 7 #import <Cocoa/Cocoa.h> | 7 #import <Cocoa/Cocoa.h> |
| 8 | 8 |
| 9 #include "base/mac/bundle_locations.h" | 9 #include "base/mac/bundle_locations.h" |
| 10 #include "base/mac/mac_util.h" | 10 #include "base/mac/mac_util.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 class WebContentsObserverBridge : public content::WebContentsObserver { | 42 class WebContentsObserverBridge : public content::WebContentsObserver { |
| 43 public: | 43 public: |
| 44 WebContentsObserverBridge(WebContents* web_contents, | 44 WebContentsObserverBridge(WebContents* web_contents, |
| 45 HungRendererController* controller) | 45 HungRendererController* controller) |
| 46 : content::WebContentsObserver(web_contents), | 46 : content::WebContentsObserver(web_contents), |
| 47 controller_(controller) { | 47 controller_(controller) { |
| 48 } | 48 } |
| 49 | 49 |
| 50 protected: | 50 protected: |
| 51 // WebContentsObserver overrides: | 51 // WebContentsObserver overrides: |
| 52 virtual void RenderViewGone(base::TerminationStatus status) OVERRIDE { | 52 virtual void RenderProcessGone(base::TerminationStatus status) OVERRIDE { |
| 53 [controller_ renderViewGone]; | 53 [controller_ renderProcessGone]; |
| 54 } | 54 } |
| 55 virtual void WebContentsDestroyed(WebContents* tab) OVERRIDE { | 55 virtual void WebContentsDestroyed(WebContents* tab) OVERRIDE { |
| 56 [controller_ renderViewGone]; | 56 [controller_ renderProcessGone]; |
| 57 } | 57 } |
| 58 | 58 |
| 59 private: | 59 private: |
| 60 HungRendererController* controller_; // weak | 60 HungRendererController* controller_; // weak |
| 61 | 61 |
| 62 DISALLOW_COPY_AND_ASSIGN(WebContentsObserverBridge); | 62 DISALLOW_COPY_AND_ASSIGN(WebContentsObserverBridge); |
| 63 }; | 63 }; |
| 64 | 64 |
| 65 @implementation HungRendererController | 65 @implementation HungRendererController |
| 66 | 66 |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 - (void)endForWebContents:(WebContents*)contents { | 198 - (void)endForWebContents:(WebContents*)contents { |
| 199 DCHECK(contents); | 199 DCHECK(contents); |
| 200 DCHECK(hungContents_); | 200 DCHECK(hungContents_); |
| 201 if (hungContents_ && hungContents_->GetRenderProcessHost() == | 201 if (hungContents_ && hungContents_->GetRenderProcessHost() == |
| 202 contents->GetRenderProcessHost()) { | 202 contents->GetRenderProcessHost()) { |
| 203 // Cannot call performClose:, because the close button is disabled. | 203 // Cannot call performClose:, because the close button is disabled. |
| 204 [self close]; | 204 [self close]; |
| 205 } | 205 } |
| 206 } | 206 } |
| 207 | 207 |
| 208 - (void)renderViewGone { | 208 - (void)renderProcessGone { |
| 209 // Cannot call performClose:, because the close button is disabled. | 209 // Cannot call performClose:, because the close button is disabled. |
| 210 [self close]; | 210 [self close]; |
| 211 } | 211 } |
| 212 | 212 |
| 213 @end | 213 @end |
| 214 | 214 |
| 215 @implementation HungRendererController (JustForTesting) | 215 @implementation HungRendererController (JustForTesting) |
| 216 - (NSButton*)killButton { | 216 - (NSButton*)killButton { |
| 217 return killButton_; | 217 return killButton_; |
| 218 } | 218 } |
| (...skipping 13 matching lines...) Expand all Loading... |
| 232 [g_instance showForWebContents:contents]; | 232 [g_instance showForWebContents:contents]; |
| 233 } | 233 } |
| 234 } | 234 } |
| 235 | 235 |
| 236 void HideHungRendererDialog(WebContents* contents) { | 236 void HideHungRendererDialog(WebContents* contents) { |
| 237 if (!logging::DialogsAreSuppressed() && g_instance) | 237 if (!logging::DialogsAreSuppressed() && g_instance) |
| 238 [g_instance endForWebContents:contents]; | 238 [g_instance endForWebContents:contents]; |
| 239 } | 239 } |
| 240 | 240 |
| 241 } // namespace chrome | 241 } // namespace chrome |
| OLD | NEW |