Index: chrome/browser/ui/cocoa/javascript_app_modal_dialog_cocoa.mm |
diff --git a/chrome/browser/ui/cocoa/javascript_app_modal_dialog_cocoa.mm b/chrome/browser/ui/cocoa/javascript_app_modal_dialog_cocoa.mm |
index 7341835b372e3527306b29bcf4a07474317b3d93..40eabaaaf37c40eec31ffad74aea1f26d5846477 100644 |
--- a/chrome/browser/ui/cocoa/javascript_app_modal_dialog_cocoa.mm |
+++ b/chrome/browser/ui/cocoa/javascript_app_modal_dialog_cocoa.mm |
@@ -17,6 +17,8 @@ |
#include "ui/base/l10n/l10n_util_mac.h" |
#include "ui/base/ui_base_types.h" |
+const int kMessageTextMaxRows = 32; |
jeremy
2014/01/21 21:24:39
This is a cross-platform limit right, WDYT about u
|
+ |
// Helper object that receives the notification that the dialog/sheet is |
// going away. Is responsible for cleaning itself up. |
@interface JavaScriptAppModalDialogHelper : NSObject<NSAlertDelegate> { |
@@ -146,6 +148,16 @@ JavaScriptAppModalDialogCocoa::JavaScriptAppModalDialogCocoa( |
[alert_ setDelegate:helper_]; |
NSString* informative_text = |
base::SysUTF16ToNSString(dialog_->message_text()); |
+ |
+ NSArray * informative_text_array = |
jeremy
2014/01/21 21:24:39
Add a comment with a link to the bug - something l
|
+ [informative_text componentsSeparatedByCharactersInSet: |
+ [NSCharacterSet newlineCharacterSet]]; |
+ if ([informative_text_array count] > kMessageTextMaxRows) { |
+ informative_text = [[[[informative_text_array subarrayWithRange: |
+ NSMakeRange(0, kMessageTextMaxRows)] valueForKey:@"description"] |
+ componentsJoinedByString:@"\n"] stringByAppendingString:@"\n..."]; |
jeremy
2014/01/21 21:24:39
Can you split this up into 3 or 4 statements so th
|
+ } |
+ |
[alert_ setInformativeText:informative_text]; |
NSString* message_text = |
base::SysUTF16ToNSString(dialog_->title()); |