Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(175)

Unified Diff: chrome/browser/ui/app_modal_dialogs/js_modal_dialog.cc

Issue 5964007: Last part of change for bug 49747.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « app/text_elider_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/app_modal_dialogs/js_modal_dialog.cc
===================================================================
--- chrome/browser/ui/app_modal_dialogs/js_modal_dialog.cc (revision 69878)
+++ chrome/browser/ui/app_modal_dialogs/js_modal_dialog.cc (working copy)
@@ -6,6 +6,7 @@
#include "app/text_elider.h"
#include "base/string_util.h"
+#include "base/utf_string_conversions.h"
#include "chrome/browser/browser_shutdown.h"
#include "chrome/browser/extensions/extension_host.h"
#include "chrome/browser/tab_contents/tab_contents.h"
@@ -17,7 +18,8 @@
namespace {
// The maximum sizes of various texts passed to us from javascript.
-const int kMessageTextMaxSize = 3000;
+const int kMessageTextMaxRows = 32;
+const int kMessageTextMaxCols = 132;
const int kDefaultPromptTextSize = 2000;
} // namespace
@@ -40,7 +42,10 @@
reply_msg_(reply_msg) {
// We trim the various parts of the message dialog because otherwise we can
// overflow the message dialog (and crash/hang the GTK+ version).
- gfx::ElideString(message_text, kMessageTextMaxSize, &message_text_);
+ string16 elided_text;
+ gfx::ElideRectangleString(WideToUTF16(message_text),
+ kMessageTextMaxRows, kMessageTextMaxCols, &elided_text);
+ message_text_ = UTF16ToWide(elided_text);
gfx::ElideString(default_prompt_text, kDefaultPromptTextSize,
&default_prompt_text_);
« no previous file with comments | « app/text_elider_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698