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

Unified Diff: chrome/browser/browser_main_mac.mm

Issue 27108: Temporary fix for the Cocoa-in-renderer problem. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/browser_main_mac.mm
===================================================================
--- chrome/browser/browser_main_mac.mm (revision 10214)
+++ chrome/browser/browser_main_mac.mm (working copy)
@@ -12,7 +12,7 @@
namespace Platform {
// Perform and platform-specific work that needs to be done before the main
-// message loop is created and initialized.
+// message loop is created and initialized.
//
// For Mac, this involves telling Cooca to finish its initalization, which we
// want to do manually instead of calling NSApplicationMain(). The primary
@@ -24,13 +24,26 @@
void WillInitializeMainMessageLoop(const CommandLine & command_line) {
[NSApplication sharedApplication];
[NSBundle loadNibNamed:@"MainMenu" owner:NSApp];
+
+ // TODO(port): Use of LSUIElement=1 is a temporary fix. The right
+ // answer is to fix the renderer to not use Cocoa.
+ //
+ // Chromium.app currently as LSUIElement=1 in it's Info.plist. This
+ // allows subprocesses (created with a relaunch of our binary) to
+ // create an NSApplication without showing up in the dock.
+ // Subprocesses (such as the renderer) need an NSApplication for
+ // Cocoa happiness However, for the browser itself, we DO want it in
+ // the dock. These 3 lines make it happen.
pink (ping after 24hrs) 2009/02/25 13:59:34 would be helpful to have the bug# here for referen
+ ProcessSerialNumber psn;
+ GetCurrentProcess(&psn);
+ TransformProcessType(&psn, kProcessTransformToForegroundApplication);
pink (ping after 24hrs) 2009/02/25 13:59:34 extra space after comma?
}
// Perform platform-specific work that needs to be done after the main event
// loop has ended. We need to send the notifications that Cooca normally would
// telling everyone the app is about to end.
void WillTerminate() {
- [[NSNotificationCenter defaultCenter]
+ [[NSNotificationCenter defaultCenter]
postNotificationName:NSApplicationWillTerminateNotification
object:NSApp];
}

Powered by Google App Engine
This is Rietveld 408576698