diff options
author | thomasvl@chromium.org <thomasvl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-01 17:42:02 +0000 |
---|---|---|
committer | thomasvl@chromium.org <thomasvl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-01 17:42:02 +0000 |
commit | f2c20fa96403a8db390bc7790b67e1906dad179b (patch) | |
tree | b7bccda23fceb0078abc9b24f8c21239fc8dce2c /chrome/browser/app_controller_mac.mm | |
parent | 2ae9a9eaea7990492ad110d7f7cc9d9809a4c60a (diff) | |
download | chromium_src-f2c20fa96403a8db390bc7790b67e1906dad179b.zip chromium_src-f2c20fa96403a8db390bc7790b67e1906dad179b.tar.gz chromium_src-f2c20fa96403a8db390bc7790b67e1906dad179b.tar.bz2 |
Mark the help menu as such so Cocoa adds the search item.
BUG=28987
TEST=set lang to french, launch, the help menu should have search option on 10.6
Review URL: http://codereview.chromium.org/452011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33450 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/app_controller_mac.mm')
-rw-r--r-- | chrome/browser/app_controller_mac.mm | 16 |
1 files changed, 16 insertions, 0 deletions
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]; } |