| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/favicon/favicon_tab_helper.h" | 12 #include "chrome/browser/favicon/favicon_tab_helper.h" |
| 13 #include "chrome/browser/ui/browser_dialogs.h" | 13 #include "chrome/browser/ui/browser_dialogs.h" |
| 14 #include "chrome/browser/ui/browser_list.h" | 14 #include "chrome/browser/ui/browser_list.h" |
| 15 #import "chrome/browser/ui/cocoa/multi_key_equivalent_button.h" | 15 #import "chrome/browser/ui/cocoa/multi_key_equivalent_button.h" |
| 16 #import "chrome/browser/ui/cocoa/tab_contents/favicon_util.h" | 16 #import "chrome/browser/ui/cocoa/tab_contents/favicon_util.h" |
| 17 #include "chrome/browser/ui/tab_contents/core_tab_helper.h" |
| 17 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 18 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
| 18 #include "chrome/common/logging_chrome.h" | 19 #include "chrome/common/logging_chrome.h" |
| 19 #include "content/browser/renderer_host/render_view_host.h" | 20 #include "content/browser/renderer_host/render_view_host.h" |
| 20 #include "content/browser/tab_contents/tab_contents.h" | 21 #include "content/browser/tab_contents/tab_contents.h" |
| 21 #include "content/public/browser/render_process_host.h" | 22 #include "content/public/browser/render_process_host.h" |
| 22 #include "content/public/common/result_codes.h" | 23 #include "content/public/common/result_codes.h" |
| 23 #include "grit/chromium_strings.h" | 24 #include "grit/chromium_strings.h" |
| 24 #include "grit/generated_resources.h" | 25 #include "grit/generated_resources.h" |
| 25 #include "grit/theme_resources.h" | 26 #include "grit/theme_resources.h" |
| 26 #include "grit/ui_resources.h" | 27 #include "grit/ui_resources.h" |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 DCHECK(contents); | 167 DCHECK(contents); |
| 167 hungContents_ = contents; | 168 hungContents_ = contents; |
| 168 hungContentsObserver_.reset(new TabContentsObserverBridge(contents, self)); | 169 hungContentsObserver_.reset(new TabContentsObserverBridge(contents, self)); |
| 169 scoped_nsobject<NSMutableArray> titles([[NSMutableArray alloc] init]); | 170 scoped_nsobject<NSMutableArray> titles([[NSMutableArray alloc] init]); |
| 170 scoped_nsobject<NSMutableArray> favicons([[NSMutableArray alloc] init]); | 171 scoped_nsobject<NSMutableArray> favicons([[NSMutableArray alloc] init]); |
| 171 for (TabContentsIterator it; !it.done(); ++it) { | 172 for (TabContentsIterator it; !it.done(); ++it) { |
| 172 if (it->tab_contents()->GetRenderProcessHost() == | 173 if (it->tab_contents()->GetRenderProcessHost() == |
| 173 hungContents_->GetRenderProcessHost()) { | 174 hungContents_->GetRenderProcessHost()) { |
| 174 string16 title = (*it)->tab_contents()->GetTitle(); | 175 string16 title = (*it)->tab_contents()->GetTitle(); |
| 175 if (title.empty()) | 176 if (title.empty()) |
| 176 title = TabContentsWrapper::GetDefaultTitle(); | 177 title = CoreTabHelper::GetDefaultTitle(); |
| 177 [titles addObject:base::SysUTF16ToNSString(title)]; | 178 [titles addObject:base::SysUTF16ToNSString(title)]; |
| 178 [favicons addObject:mac::FaviconForTabContents(*it)]; | 179 [favicons addObject:mac::FaviconForTabContents(*it)]; |
| 179 } | 180 } |
| 180 } | 181 } |
| 181 hungTitles_.reset([titles copy]); | 182 hungTitles_.reset([titles copy]); |
| 182 hungFavicons_.reset([favicons copy]); | 183 hungFavicons_.reset([favicons copy]); |
| 183 [tableView_ reloadData]; | 184 [tableView_ reloadData]; |
| 184 | 185 |
| 185 [[self window] center]; | 186 [[self window] center]; |
| 186 [self showWindow:self]; | 187 [self showWindow:self]; |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 [g_instance showForTabContents:contents]; | 224 [g_instance showForTabContents:contents]; |
| 224 } | 225 } |
| 225 } | 226 } |
| 226 | 227 |
| 227 void HideNativeHungRendererDialog(TabContents* contents) { | 228 void HideNativeHungRendererDialog(TabContents* contents) { |
| 228 if (!logging::DialogsAreSuppressed() && g_instance) | 229 if (!logging::DialogsAreSuppressed() && g_instance) |
| 229 [g_instance endForTabContents:contents]; | 230 [g_instance endForTabContents:contents]; |
| 230 } | 231 } |
| 231 | 232 |
| 232 } // namespace browser | 233 } // namespace browser |
| OLD | NEW |