diff options
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/app_controller_mac.h | 4 | ||||
-rw-r--r-- | chrome/browser/app_controller_mac.mm | 16 |
2 files changed, 20 insertions, 0 deletions
diff --git a/chrome/browser/app_controller_mac.h b/chrome/browser/app_controller_mac.h index 44af869a..ba04a49 100644 --- a/chrome/browser/app_controller_mac.h +++ b/chrome/browser/app_controller_mac.h @@ -44,6 +44,10 @@ class Profile; IBOutlet NSMenuItem* closeTabMenuItem_; IBOutlet NSMenuItem* closeWindowMenuItem_; BOOL fileMenuUpdatePending_; // ensure we only do this once per notificaion. + + // Outlet for the help menu so we can bless it so Cocoa adds the search item + // to it. + IBOutlet NSMenu* helpMenu_; } - (void)didEndMainMessageLoop; diff --git a/chrome/browser/app_controller_mac.mm b/chrome/browser/app_controller_mac.mm index 5a93c8d..b2828ae 100644 --- a/chrome/browser/app_controller_mac.mm +++ b/chrome/browser/app_controller_mac.mm @@ -46,6 +46,16 @@ #include "grit/chromium_strings.h" #include "grit/generated_resources.h" +// 10.6 adds a public API for the Spotlight-backed search menu item in the Help +// menu. Provide the declaration so it can be called below when building with +// the 10.5 SDK. +#if !defined(MAC_OS_X_VERSION_10_6) || \ + MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_6 +@interface NSApplication (SnowLeopardSDKDeclarations) +- (void)setHelpMenu:(NSMenu *)helpMenu; +@end +#endif + @interface AppController(PRIVATE) - (void)initMenuState; - (void)openURLs:(const std::vector<GURL>&)urls; @@ -341,6 +351,12 @@ static bool g_is_opening_new_window = false; EncodingMenuControllerDelegate::BuildEncodingMenu([self defaultProfile], encoding_menu); + // Since Chrome is localized to more languages than the OS, tell Cocoa which + // menu is the Help so it can add the search item to it. + if (helpMenu_ && [NSApp respondsToSelector:@selector(setHelpMenu:)]) { + [NSApp setHelpMenu:helpMenu_]; + } + // Now that we're initialized we can open any URLs we've been holding onto. [self openPendingURLs]; } |