| OLD | NEW |
| 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/app_controller_mac.h" | 5 #import "chrome/browser/app_controller_mac.h" |
| 6 | 6 |
| 7 #include "app/l10n_util_mac.h" | 7 #include "app/l10n_util_mac.h" |
| 8 #include "base/auto_reset.h" | 8 #include "base/auto_reset.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/mac_util.h" | 10 #include "base/mac_util.h" |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 // Activate (bring to foreground) if asked to do so. On | 208 // Activate (bring to foreground) if asked to do so. On |
| 209 // Windows this logic isn't necessary since | 209 // Windows this logic isn't necessary since |
| 210 // BrowserWindow::Activate() calls ::SetForegroundWindow() which is | 210 // BrowserWindow::Activate() calls ::SetForegroundWindow() which is |
| 211 // adequate. On Mac, BrowserWindow::Activate() calls -[NSWindow | 211 // adequate. On Mac, BrowserWindow::Activate() calls -[NSWindow |
| 212 // makeKeyAndOrderFront:] which does not activate the application | 212 // makeKeyAndOrderFront:] which does not activate the application |
| 213 // itself. | 213 // itself. |
| 214 const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); | 214 const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); |
| 215 if (parsed_command_line.HasSwitch(switches::kActivateOnLaunch)) { | 215 if (parsed_command_line.HasSwitch(switches::kActivateOnLaunch)) { |
| 216 [NSApp activateIgnoringOtherApps:YES]; | 216 [NSApp activateIgnoringOtherApps:YES]; |
| 217 } | 217 } |
| 218 |
| 219 if (!parsed_command_line.HasSwitch(switches::kEnableExposeForTabs)) { |
| 220 [tabposeMenuItem_ setHidden:YES]; |
| 221 } |
| 218 } | 222 } |
| 219 | 223 |
| 220 // (NSApplicationDelegate protocol) This is the Apple-approved place to override | 224 // (NSApplicationDelegate protocol) This is the Apple-approved place to override |
| 221 // the default handlers. | 225 // the default handlers. |
| 222 - (void)applicationWillFinishLaunching:(NSNotification*)notification { | 226 - (void)applicationWillFinishLaunching:(NSNotification*)notification { |
| 223 // Nothing here right now. | 227 // Nothing here right now. |
| 224 } | 228 } |
| 225 | 229 |
| 226 - (BOOL)tryToTerminateApplication:(NSApplication*)app { | 230 - (BOOL)tryToTerminateApplication:(NSApplication*)app { |
| 227 // Check for in-process downloads, and prompt the user if they really want | 231 // Check for in-process downloads, and prompt the user if they really want |
| (...skipping 832 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1060 [appController showPreferencesWindow:nil page:page profile:profile]; | 1064 [appController showPreferencesWindow:nil page:page profile:profile]; |
| 1061 } | 1065 } |
| 1062 | 1066 |
| 1063 namespace app_controller_mac { | 1067 namespace app_controller_mac { |
| 1064 | 1068 |
| 1065 bool IsOpeningNewWindow() { | 1069 bool IsOpeningNewWindow() { |
| 1066 return g_is_opening_new_window; | 1070 return g_is_opening_new_window; |
| 1067 } | 1071 } |
| 1068 | 1072 |
| 1069 } // namespace app_controller_mac | 1073 } // namespace app_controller_mac |
| OLD | NEW |