| 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 970 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 981 | 981 |
| 982 [aboutController_ showWindow:self]; | 982 [aboutController_ showWindow:self]; |
| 983 } | 983 } |
| 984 | 984 |
| 985 // Explicitly bring to the foreground when creating new windows from the dock. | 985 // Explicitly bring to the foreground when creating new windows from the dock. |
| 986 - (void)newWindowFromDock:(id)sender { | 986 - (void)newWindowFromDock:(id)sender { |
| 987 [NSApp activateIgnoringOtherApps:YES]; | 987 [NSApp activateIgnoringOtherApps:YES]; |
| 988 [self commandDispatch:sender]; | 988 [self commandDispatch:sender]; |
| 989 } | 989 } |
| 990 | 990 |
| 991 - (NSMenu*)applicationDockMenu:(id)sender { | 991 - (NSMenu*)applicationDockMenu:(NSApplication*)sender { |
| 992 NSMenu* dockMenu = [[[NSMenu alloc] initWithTitle: @""] autorelease]; | 992 NSMenu* dockMenu = [[[NSMenu alloc] initWithTitle: @""] autorelease]; |
| 993 NSString* titleStr = l10n_util::GetNSStringWithFixup(IDS_NEW_WINDOW_MAC); | 993 NSString* titleStr = l10n_util::GetNSStringWithFixup(IDS_NEW_WINDOW_MAC); |
| 994 scoped_nsobject<NSMenuItem> item([[NSMenuItem alloc] | 994 scoped_nsobject<NSMenuItem> item([[NSMenuItem alloc] |
| 995 initWithTitle:titleStr | 995 initWithTitle:titleStr |
| 996 action:@selector(newWindowFromDock:) | 996 action:@selector(newWindowFromDock:) |
| 997 keyEquivalent:@""]); | 997 keyEquivalent:@""]); |
| 998 [item setTarget:self]; | 998 [item setTarget:self]; |
| 999 [item setTag:IDC_NEW_WINDOW]; | 999 [item setTag:IDC_NEW_WINDOW]; |
| 1000 [dockMenu addItem:item]; | 1000 [dockMenu addItem:item]; |
| 1001 | 1001 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 1030 [appController showPreferencesWindow:nil page:page profile:profile]; | 1030 [appController showPreferencesWindow:nil page:page profile:profile]; |
| 1031 } | 1031 } |
| 1032 | 1032 |
| 1033 namespace app_controller_mac { | 1033 namespace app_controller_mac { |
| 1034 | 1034 |
| 1035 bool IsOpeningNewWindow() { | 1035 bool IsOpeningNewWindow() { |
| 1036 return g_is_opening_new_window; | 1036 return g_is_opening_new_window; |
| 1037 } | 1037 } |
| 1038 | 1038 |
| 1039 } // namespace app_controller_mac | 1039 } // namespace app_controller_mac |
| OLD | NEW |