summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authorjrg@chromium.org <jrg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-25 04:56:21 +0000
committerjrg@chromium.org <jrg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-25 04:56:21 +0000
commite5fd10f6814759585a44c4f29353dd36269b4b06 (patch)
tree2e6a8cf4d614258839346c481295fe4f507abb27 /chrome/browser
parent0dbb1ebc5db4d16057884de523d8af80eaf017db (diff)
downloadchromium_src-e5fd10f6814759585a44c4f29353dd36269b4b06.zip
chromium_src-e5fd10f6814759585a44c4f29353dd36269b4b06.tar.gz
chromium_src-e5fd10f6814759585a44c4f29353dd36269b4b06.tar.bz2
Temporary fix for the Cocoa-in-renderer problem.
Review URL: http://codereview.chromium.org/27108 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10326 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/browser_main_mac.mm17
1 files changed, 15 insertions, 2 deletions
diff --git a/chrome/browser/browser_main_mac.mm b/chrome/browser/browser_main_mac.mm
index 719ee96..f926244 100644
--- a/chrome/browser/browser_main_mac.mm
+++ b/chrome/browser/browser_main_mac.mm
@@ -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 @@ namespace Platform {
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.
+ ProcessSerialNumber psn;
+ GetCurrentProcess(&psn);
+ TransformProcessType(&psn, kProcessTransformToForegroundApplication);
}
// 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];
}