diff options
author | mirandac@chromium.org <mirandac@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-07 16:26:14 +0000 |
---|---|---|
committer | mirandac@chromium.org <mirandac@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-07 16:26:14 +0000 |
commit | a0b1751f438242e8f97dc1e8412e8964a2adda44 (patch) | |
tree | 9ac545eb31394d16f06931aa0d2570704ce73b6c /chrome | |
parent | 2799c02a46d0d8d2726f19c8b100ff67504a7349 (diff) | |
download | chromium_src-a0b1751f438242e8f97dc1e8412e8964a2adda44.zip chromium_src-a0b1751f438242e8f97dc1e8412e8964a2adda44.tar.gz chromium_src-a0b1751f438242e8f97dc1e8412e8964a2adda44.tar.bz2 |
Allow return key to add new line in description text field.
BUG= 26860
TEST= open bug report. enter multi-line description, using return to insert newlines.
Review URL: http://codereview.chromium.org/374024
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31388 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/app/nibs/ReportBug.xib | 12 | ||||
-rw-r--r-- | chrome/browser/cocoa/bug_report_window_controller.h | 9 | ||||
-rw-r--r-- | chrome/browser/cocoa/bug_report_window_controller.mm | 11 |
3 files changed, 28 insertions, 4 deletions
diff --git a/chrome/app/nibs/ReportBug.xib b/chrome/app/nibs/ReportBug.xib index 7e21354..46849b8 100644 --- a/chrome/app/nibs/ReportBug.xib +++ b/chrome/app/nibs/ReportBug.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="95"/> + <integer value="108"/> </object> <object class="NSArray" key="IBDocument.PluginDependencies"> <bool key="EncodedWithXMLCoder">YES</bool> @@ -616,6 +616,14 @@ </object> <int key="connectionID">131</int> </object> + <object class="IBConnectionRecord"> + <object class="IBOutletConnection" key="connection"> + <string key="label">delegate</string> + <reference key="source" ref="907418310"/> + <reference key="destination" ref="1001"/> + </object> + <int key="connectionID">132</int> + </object> </object> <object class="IBMutableOrderedSet" key="objectRecords"> <object class="NSArray" key="orderedObjects"> @@ -979,7 +987,7 @@ </object> </object> <nil key="sourceID"/> - <int key="maxID">131</int> + <int key="maxID">132</int> </object> <object class="IBClassDescriber" key="IBDocument.Classes"> <object class="NSMutableArray" key="referencedPartialClassDescriptions"> diff --git a/chrome/browser/cocoa/bug_report_window_controller.h b/chrome/browser/cocoa/bug_report_window_controller.h index 20c29aa..3de0bf1 100644 --- a/chrome/browser/cocoa/bug_report_window_controller.h +++ b/chrome/browser/cocoa/bug_report_window_controller.h @@ -73,7 +73,14 @@ class TabContents; // bouncing to the phish report page instead of sending a report directly // from the dialog box (or vice versa). Observe the menu of bug types // and change the button title along with the selected bug. -- (void)menu:(NSMenu *)menu willHighlightItem:(NSMenuItem *)item; +- (void)menu:(NSMenu*)menu willHighlightItem:(NSMenuItem *)item; + +// Force the description text field to allow "return" to go to the next line +// within the description field. Without this delegate method, "return" falls +// back to the "Send Report" action, because this button has been bound to +// the return key in IB. +- (BOOL)control:(NSControl*)control textView:(NSTextView*)textView + doCommandBySelector:(SEL)commandSelector; // Properties for bindings. @property (copy, nonatomic) NSString* bugDescription; diff --git a/chrome/browser/cocoa/bug_report_window_controller.mm b/chrome/browser/cocoa/bug_report_window_controller.mm index 5dc9f42..d61adc4 100644 --- a/chrome/browser/cocoa/bug_report_window_controller.mm +++ b/chrome/browser/cocoa/bug_report_window_controller.mm @@ -129,7 +129,7 @@ l10n_util::GetNSStringWithFixup(IDS_BUGREPORT_PHISHING_PAGE)]; } -- (void)menu:(NSMenu *)menu willHighlightItem:(NSMenuItem *)item { +- (void)menu:(NSMenu*)menu willHighlightItem:(NSMenuItem *)item { NSString* buttonTitle = [[item title] isEqualToString: l10n_util::GetNSStringWithFixup(IDS_BUGREPORT_PHISHING_PAGE)] ? l10n_util::GetNSStringWithFixup(IDS_BUGREPORT_SEND_PHISHING_REPORT) : @@ -147,6 +147,15 @@ } } +- (BOOL)control:(NSControl*)control textView:(NSTextView*)textView + doCommandBySelector:(SEL)commandSelector { + if (commandSelector == @selector(insertNewline:)) { + [textView insertNewlineIgnoringFieldEditor:self]; + return YES; + } + return NO; +} + // BugReportWindowController needs to change the title of the Send Report // button when the user chooses the phishing bug type, so we need to bind // the function that changes the button title to the bug type key. |