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

Side by Side Diff: chrome/browser/app_controller_mac.mm

Issue 7215040: Fix relaunches on the Mac (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 6 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
OLDNEW
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/app_controller_mac.h" 5 #import "chrome/browser/app_controller_mac.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/file_path.h" 9 #include "base/file_path.h"
10 #include "base/mac/foundation_util.h" 10 #include "base/mac/foundation_util.h"
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 name:NSWindowDidBecomeMainNotification 205 name:NSWindowDidBecomeMainNotification
206 object:nil]; 206 object:nil];
207 [notificationCenter 207 [notificationCenter
208 addObserver:self 208 addObserver:self
209 selector:@selector(windowLayeringDidChange:) 209 selector:@selector(windowLayeringDidChange:)
210 name:NSWindowDidResignMainNotification 210 name:NSWindowDidResignMainNotification
211 object:nil]; 211 object:nil];
212 212
213 // Set up the command updater for when there are no windows open 213 // Set up the command updater for when there are no windows open
214 [self initMenuState]; 214 [self initMenuState];
215
216 // Activate (bring to foreground) if asked to do so. On
217 // Windows this logic isn't necessary since
218 // BrowserWindow::Activate() calls ::SetForegroundWindow() which is
219 // adequate. On Mac, BrowserWindow::Activate() calls -[NSWindow
220 // makeKeyAndOrderFront:] which does not activate the application
221 // itself.
222 const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess();
223 if (parsed_command_line.HasSwitch(switches::kActivateOnLaunch)) {
224 [NSApp activateIgnoringOtherApps:YES];
225 }
226 } 215 }
227 216
228 // (NSApplicationDelegate protocol) This is the Apple-approved place to override 217 // (NSApplicationDelegate protocol) This is the Apple-approved place to override
229 // the default handlers. 218 // the default handlers.
230 - (void)applicationWillFinishLaunching:(NSNotification*)notification { 219 - (void)applicationWillFinishLaunching:(NSNotification*)notification {
231 // Nothing here right now. 220 // Nothing here right now.
232 } 221 }
233 222
234 - (BOOL)tryToTerminateApplication:(NSApplication*)app { 223 - (BOOL)tryToTerminateApplication:(NSApplication*)app {
235 // Check for in-process downloads, and prompt the user if they really want 224 // Check for in-process downloads, and prompt the user if they really want
(...skipping 971 matching lines...) Expand 10 before | Expand all | Expand 10 after
1207 1196
1208 } // namespace browser 1197 } // namespace browser
1209 1198
1210 namespace app_controller_mac { 1199 namespace app_controller_mac {
1211 1200
1212 bool IsOpeningNewWindow() { 1201 bool IsOpeningNewWindow() {
1213 return g_is_opening_new_window; 1202 return g_is_opening_new_window;
1214 } 1203 }
1215 1204
1216 } // namespace app_controller_mac 1205 } // namespace app_controller_mac
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698