| 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 | 77 |
| 78 - (void)dealloc { | 78 - (void)dealloc { |
| 79 DCHECK(!g_instance); | 79 DCHECK(!g_instance); |
| 80 [tableView_ setDataSource:nil]; | 80 [tableView_ setDataSource:nil]; |
| 81 [super dealloc]; | 81 [super dealloc]; |
| 82 } | 82 } |
| 83 | 83 |
| 84 - (void)awakeFromNib { | 84 - (void)awakeFromNib { |
| 85 // Load in the image | 85 // Load in the image |
| 86 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 86 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
| 87 NSImage* backgroundImage = rb.GetNativeImageNamed(IDR_FROZEN_TAB_ICON); | 87 NSImage* backgroundImage = |
| 88 DCHECK(backgroundImage); | 88 rb.GetNativeImageNamed(IDR_FROZEN_TAB_ICON).ToNSImage(); |
| 89 [imageView_ setImage:backgroundImage]; | 89 [imageView_ setImage:backgroundImage]; |
| 90 | 90 |
| 91 // Make the message fit. | 91 // Make the message fit. |
| 92 CGFloat messageShift = | 92 CGFloat messageShift = |
| 93 [GTMUILocalizerAndLayoutTweaker sizeToFitFixedWidthTextField:messageView_]; | 93 [GTMUILocalizerAndLayoutTweaker sizeToFitFixedWidthTextField:messageView_]; |
| 94 | 94 |
| 95 // Move the graphic up to be top even with the message. | 95 // Move the graphic up to be top even with the message. |
| 96 NSRect graphicFrame = [imageView_ frame]; | 96 NSRect graphicFrame = [imageView_ frame]; |
| 97 graphicFrame.origin.y += messageShift; | 97 graphicFrame.origin.y += messageShift; |
| 98 [imageView_ setFrame:graphicFrame]; | 98 [imageView_ setFrame:graphicFrame]; |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 [g_instance showForWebContents:contents]; | 227 [g_instance showForWebContents:contents]; |
| 228 } | 228 } |
| 229 } | 229 } |
| 230 | 230 |
| 231 void HideHungRendererDialog(WebContents* contents) { | 231 void HideHungRendererDialog(WebContents* contents) { |
| 232 if (!logging::DialogsAreSuppressed() && g_instance) | 232 if (!logging::DialogsAreSuppressed() && g_instance) |
| 233 [g_instance endForWebContents:contents]; | 233 [g_instance endForWebContents:contents]; |
| 234 } | 234 } |
| 235 | 235 |
| 236 } // namespace chrome | 236 } // namespace chrome |
| OLD | NEW |