| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/mac_util.h" | 9 #include "base/mac/mac_util.h" |
| 10 #include "base/process_util.h" | 10 #include "base/process_util.h" |
| 11 #include "base/sys_string_conversions.h" | 11 #include "base/sys_string_conversions.h" |
| 12 #include "chrome/browser/browser_list.h" | 12 #include "chrome/browser/browser_list.h" |
| 13 #include "chrome/browser/hung_renderer_dialog.h" | 13 #include "chrome/browser/hung_renderer_dialog.h" |
| 14 #include "chrome/browser/renderer_host/render_process_host.h" | 14 #include "chrome/browser/renderer_host/render_process_host.h" |
| 15 #include "chrome/browser/renderer_host/render_view_host.h" | 15 #include "chrome/browser/renderer_host/render_view_host.h" |
| 16 #include "chrome/browser/tab_contents/tab_contents.h" | 16 #include "chrome/browser/tab_contents/tab_contents.h" |
| 17 #import "chrome/browser/ui/cocoa/multi_key_equivalent_button.h" | 17 #import "chrome/browser/ui/cocoa/multi_key_equivalent_button.h" |
| 18 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 18 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
| 19 #include "chrome/common/logging_chrome.h" | 19 #include "chrome/common/logging_chrome.h" |
| 20 #include "chrome/common/result_codes.h" | 20 #include "chrome/common/result_codes.h" |
| 21 #include "grit/chromium_strings.h" | 21 #include "grit/chromium_strings.h" |
| 22 #include "grit/app_resources.h" | 22 #include "grit/app_resources.h" |
| 23 #include "grit/generated_resources.h" | 23 #include "grit/generated_resources.h" |
| 24 #include "grit/theme_resources.h" | 24 #include "grit/theme_resources.h" |
| 25 #include "skia/ext/skia_utils_mac.h" | 25 #include "skia/ext/skia_utils_mac.h" |
| 26 #include "third_party/GTM/AppKit/GTMUILocalizerAndLayoutTweaker.h" | 26 #include "third_party/GTM/AppKit/GTMUILocalizerAndLayoutTweaker.h" |
| 27 #include "ui/base/l10n/l10n_util_mac.h" | 27 #include "ui/base/l10n/l10n_util_mac.h" |
| 28 #include "ui/base/resource/resource_bundle.h" | 28 #include "ui/base/resource/resource_bundle.h" |
| 29 #include "ui/gfx/image.h" |
| 29 | 30 |
| 30 namespace { | 31 namespace { |
| 31 // We only support showing one of these at a time per app. The | 32 // We only support showing one of these at a time per app. The |
| 32 // controller owns itself and is released when its window is closed. | 33 // controller owns itself and is released when its window is closed. |
| 33 HungRendererController* g_instance = NULL; | 34 HungRendererController* g_instance = NULL; |
| 34 } // end namespace | 35 } // end namespace |
| 35 | 36 |
| 36 @implementation HungRendererController | 37 @implementation HungRendererController |
| 37 | 38 |
| 38 - (id)initWithWindowNibName:(NSString*)nibName { | 39 - (id)initWithWindowNibName:(NSString*)nibName { |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 } | 196 } |
| 196 } | 197 } |
| 197 | 198 |
| 198 // static | 199 // static |
| 199 void HideForTabContents(TabContents* contents) { | 200 void HideForTabContents(TabContents* contents) { |
| 200 if (!logging::DialogsAreSuppressed() && g_instance) | 201 if (!logging::DialogsAreSuppressed() && g_instance) |
| 201 [g_instance endForTabContents:contents]; | 202 [g_instance endForTabContents:contents]; |
| 202 } | 203 } |
| 203 | 204 |
| 204 } // namespace hung_renderer_dialog | 205 } // namespace hung_renderer_dialog |
| OLD | NEW |