summaryrefslogtreecommitdiffstats
path: root/chrome/app
diff options
context:
space:
mode:
authorviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-07 18:54:33 +0000
committerviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-07 18:54:33 +0000
commitcddc5241ab3085c5eb82fa65ccb1bb38d962fe46 (patch)
treec27f4742a5427229d4417df9ac6c2f6398caa69b /chrome/app
parent83cb9e0a28d12f4c68e75dca6df33678f754e302 (diff)
downloadchromium_src-cddc5241ab3085c5eb82fa65ccb1bb38d962fe46.zip
chromium_src-cddc5241ab3085c5eb82fa65ccb1bb38d962fe46.tar.gz
chromium_src-cddc5241ab3085c5eb82fa65ccb1bb38d962fe46.tar.bz2
Mac: implement "Search the Web..." (Opt-Cmd-F).
This focuses the Omnibox with '?' in the contents with the text insertion point immediately after (and no selection), unless the Omnibox already has something beginning with '?' in which case it selects the text after the '?'. This is what Ctrl-K does on other platforms. On the Mac, we get a menu item (under Edit -> Find), and the Mac-standard shortcut of Opt-Cmd-F (users can set Cmd-K as a short cut in System Preferences if they really want). Changes to MainMenu.xib: added ^IDS_EDIT_SEARCH_WEB_MAC menu item ("Search the Web...", tag 39002, Opt-Cmd-F as keyboard shortcut, sending -commandDispatch: to first responder) as first item in Find submenu, followed by a separator. BUG=29501 TEST=Check that this feature has the behaviour described above (using both the menu item and using Opt-Cmd-F), with (1) nothing in the Omnibox to begin with, (2) a random URL in the Omnibox, and (3) "?<some search term(s)>". Check that the Omnibox is properly focused (so set focus to various places, and make sure that the Omnibox gets focused). Review URL: http://codereview.chromium.org/460111 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33971 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/app')
-rw-r--r--chrome/app/generated_resources.grd3
-rw-r--r--chrome/app/nibs/MainMenu.xib56
2 files changed, 53 insertions, 6 deletions
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd
index d255d69..e3aefd0 100644
--- a/chrome/app/generated_resources.grd
+++ b/chrome/app/generated_resources.grd
@@ -5886,6 +5886,9 @@ Keep your key file in a safe place. You will need it to create new versions of y
<message name="IDS_EDIT_FIND_SUBMENU_MAC" desc="The Mac menu item for the find submenu in the edit menu.">
Find
</message>
+ <message name="IDS_EDIT_SEARCH_WEB_MAC" desc="The Mac menu item for search the web (using, e.g., Google or Yahoo! search) in the edit menu.">
+ Search the Web...
+ </message>
<message name="IDS_EDIT_FIND_MAC" desc="The Mac menu item for find in the edit menu.">
Find...
</message>
diff --git a/chrome/app/nibs/MainMenu.xib b/chrome/app/nibs/MainMenu.xib
index bb33b2a..f8d2ebe 100644
--- a/chrome/app/nibs/MainMenu.xib
+++ b/chrome/app/nibs/MainMenu.xib
@@ -8,7 +8,7 @@
<string key="IBDocument.HIToolboxVersion">353.00</string>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
- <integer value="451"/>
+ <integer value="220"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -526,6 +526,26 @@
<string key="NSTitle">^IDS_EDIT_FIND_SUBMENU_MAC</string>
<object class="NSMutableArray" key="NSMenuItems">
<bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSMenuItem" id="737490158">
+ <reference key="NSMenu" ref="963351320"/>
+ <string key="NSTitle">^IDS_EDIT_SEARCH_WEB_MAC</string>
+ <string key="NSKeyEquiv">f</string>
+ <int key="NSKeyEquivModMask">1572864</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="353210768"/>
+ <reference key="NSMixedImage" ref="549394948"/>
+ <int key="NSTag">39002</int>
+ </object>
+ <object class="NSMenuItem" id="813033916">
+ <reference key="NSMenu" ref="963351320"/>
+ <bool key="NSIsDisabled">YES</bool>
+ <bool key="NSIsSeparator">YES</bool>
+ <string key="NSTitle"/>
+ <string key="NSKeyEquiv"/>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="353210768"/>
+ <reference key="NSMixedImage" ref="549394948"/>
+ </object>
<object class="NSMenuItem" id="447796847">
<reference key="NSMenu" ref="963351320"/>
<string key="NSTitle">^IDS_EDIT_FIND_MAC</string>
@@ -1679,6 +1699,14 @@
</object>
<int key="connectionID">668</int>
</object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">commandDispatch:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="737490158"/>
+ </object>
+ <int key="connectionID">671</int>
+ </object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
@@ -1957,6 +1985,8 @@
<reference ref="159080638"/>
<reference ref="326711663"/>
<reference ref="447796847"/>
+ <reference ref="813033916"/>
+ <reference ref="737490158"/>
</object>
<reference key="parent" ref="892235320"/>
</object>
@@ -2511,6 +2541,16 @@
<reference key="object" ref="784044270"/>
<reference key="parent" ref="110575045"/>
</object>
+ <object class="IBObjectRecord">
+ <int key="objectID">669</int>
+ <reference key="object" ref="813033916"/>
+ <reference key="parent" ref="963351320"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">670</int>
+ <reference key="object" ref="737490158"/>
+ <reference key="parent" ref="963351320"/>
+ </object>
</object>
</object>
<object class="NSMutableDictionary" key="flattenedProperties">
@@ -2703,6 +2743,8 @@
<string>662.IBShouldRemoveOnLegacySave</string>
<string>664.IBPluginDependency</string>
<string>665.IBPluginDependency</string>
+ <string>669.IBPluginDependency</string>
+ <string>670.IBPluginDependency</string>
<string>72.IBPluginDependency</string>
<string>72.ImportedFromIB2</string>
<string>73.IBPluginDependency</string>
@@ -2783,7 +2825,7 @@
<reference ref="9"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<reference ref="9"/>
- <string>{{536, -194}, {361, 243}}</string>
+ <string>{{98, 463}, {361, 243}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<reference ref="9"/>
<string>{{197, 734}, {243, 243}}</string>
@@ -2811,7 +2853,7 @@
<reference ref="9"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<reference ref="9"/>
- <string>{{618, 199}, {346, 103}}</string>
+ <string>{{459, 373}, {349, 133}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<reference ref="9"/>
<string>{{608, 612}, {241, 103}}</string>
@@ -2827,7 +2869,7 @@
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<reference ref="9"/>
<string>{{525, 802}, {197, 73}}</string>
- <string>{{401, 725}, {1578, 20}}</string>
+ <string>{{-317, 706}, {1578, 20}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<reference ref="9"/>
<string>{74, 862}</string>
@@ -2917,6 +2959,8 @@
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<reference ref="9"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<reference ref="9"/>
@@ -2930,7 +2974,7 @@
<reference ref="9"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<reference ref="9"/>
- <string>{{648, 422}, {353, 303}}</string>
+ <string>{{312, 422}, {353, 303}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<reference ref="9"/>
<string>{{323, 672}, {199, 203}}</string>
@@ -2962,7 +3006,7 @@
</object>
</object>
<nil key="sourceID"/>
- <int key="maxID">668</int>
+ <int key="maxID">671</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">