Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(19)

Side by Side Diff: chrome/browser/ui/cocoa/hung_renderer_controller.mm

Issue 6537015: Start moving core pieces of Chrome multi-process code to src\content. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/browser.cc ('k') | chrome/browser/ui/gtk/hung_renderer_dialog_gtk.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/common/logging_chrome.h" 19 #include "chrome/common/logging_chrome.h"
19 #include "chrome/common/result_codes.h" 20 #include "chrome/common/result_codes.h"
20 #include "grit/chromium_strings.h" 21 #include "grit/chromium_strings.h"
21 #include "grit/app_resources.h" 22 #include "grit/app_resources.h"
22 #include "grit/generated_resources.h" 23 #include "grit/generated_resources.h"
23 #include "grit/theme_resources.h" 24 #include "grit/theme_resources.h"
24 #include "skia/ext/skia_utils_mac.h" 25 #include "skia/ext/skia_utils_mac.h"
25 #include "third_party/GTM/AppKit/GTMUILocalizerAndLayoutTweaker.h" 26 #include "third_party/GTM/AppKit/GTMUILocalizerAndLayoutTweaker.h"
26 #include "ui/base/l10n/l10n_util_mac.h" 27 #include "ui/base/l10n/l10n_util_mac.h"
27 #include "ui/base/resource/resource_bundle.h" 28 #include "ui/base/resource/resource_bundle.h"
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 133
133 - (void)showForTabContents:(TabContents*)contents { 134 - (void)showForTabContents:(TabContents*)contents {
134 DCHECK(contents); 135 DCHECK(contents);
135 hungContents_ = contents; 136 hungContents_ = contents;
136 scoped_nsobject<NSMutableArray> titles([[NSMutableArray alloc] init]); 137 scoped_nsobject<NSMutableArray> titles([[NSMutableArray alloc] init]);
137 scoped_nsobject<NSMutableArray> favicons([[NSMutableArray alloc] init]); 138 scoped_nsobject<NSMutableArray> favicons([[NSMutableArray alloc] init]);
138 for (TabContentsIterator it; !it.done(); ++it) { 139 for (TabContentsIterator it; !it.done(); ++it) {
139 if (it->GetRenderProcessHost() == hungContents_->GetRenderProcessHost()) { 140 if (it->GetRenderProcessHost() == hungContents_->GetRenderProcessHost()) {
140 string16 title = (*it)->GetTitle(); 141 string16 title = (*it)->GetTitle();
141 if (title.empty()) 142 if (title.empty())
142 title = TabContents::GetDefaultTitle(); 143 title = TabContentsWrapper::GetDefaultTitle();
143 [titles addObject:base::SysUTF16ToNSString(title)]; 144 [titles addObject:base::SysUTF16ToNSString(title)];
144 145
145 // TabContents can return a null SkBitmap if it has no favicon. If this 146 // TabContents can return a null SkBitmap if it has no favicon. If this
146 // happens, use the default favicon. 147 // happens, use the default favicon.
147 const SkBitmap& bitmap = it->GetFavIcon(); 148 const SkBitmap& bitmap = it->GetFavIcon();
148 if (!bitmap.isNull()) { 149 if (!bitmap.isNull()) {
149 [favicons addObject:gfx::SkBitmapToNSImage(bitmap)]; 150 [favicons addObject:gfx::SkBitmapToNSImage(bitmap)];
150 } else { 151 } else {
151 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); 152 ResourceBundle& rb = ResourceBundle::GetSharedInstance();
152 [favicons addObject:rb.GetNativeImageNamed(IDR_DEFAULT_FAVICON)]; 153 [favicons addObject:rb.GetNativeImageNamed(IDR_DEFAULT_FAVICON)];
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 } 195 }
195 } 196 }
196 197
197 // static 198 // static
198 void HideForTabContents(TabContents* contents) { 199 void HideForTabContents(TabContents* contents) {
199 if (!logging::DialogsAreSuppressed() && g_instance) 200 if (!logging::DialogsAreSuppressed() && g_instance)
200 [g_instance endForTabContents:contents]; 201 [g_instance endForTabContents:contents];
201 } 202 }
202 203
203 } // namespace hung_renderer_dialog 204 } // namespace hung_renderer_dialog
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser.cc ('k') | chrome/browser/ui/gtk/hung_renderer_dialog_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698