summaryrefslogtreecommitdiffstats
path: root/chrome/browser/chromeos
diff options
context:
space:
mode:
authorinferno@chromium.org <inferno@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-29 22:09:37 +0000
committerinferno@chromium.org <inferno@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-29 22:09:37 +0000
commitbdb3992a2b76b27ad08293013ccfa0ca755770ba (patch)
tree50dcc844776e871f8f9e6fb98ae6540b92c2c00b /chrome/browser/chromeos
parent49b446611965a9d1c17ad1338cdfcd272d1a6d55 (diff)
downloadchromium_src-bdb3992a2b76b27ad08293013ccfa0ca755770ba.zip
chromium_src-bdb3992a2b76b27ad08293013ccfa0ca755770ba.tar.gz
chromium_src-bdb3992a2b76b27ad08293013ccfa0ca755770ba.tar.bz2
Fix the GTK crash by eliding extra long url,command strings in external protocol launch message.
BUG=35168 TEST=None Review URL: http://codereview.chromium.org/1518003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43002 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/chromeos')
-rw-r--r--chrome/browser/chromeos/external_protocol_dialog.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/chrome/browser/chromeos/external_protocol_dialog.cc b/chrome/browser/chromeos/external_protocol_dialog.cc
index 5a12dcf..860f62d 100644
--- a/chrome/browser/chromeos/external_protocol_dialog.cc
+++ b/chrome/browser/chromeos/external_protocol_dialog.cc
@@ -7,6 +7,7 @@
#include "app/l10n_util.h"
#include "app/message_box_flags.h"
#include "base/histogram.h"
+#include "base/string_util.h"
#include "base/utf_string_conversions.h"
#include "chrome/browser/external_protocol_handler.h"
#include "chrome/browser/tab_contents/tab_contents.h"
@@ -82,10 +83,15 @@ ExternalProtocolDialog::ExternalProtocolDialog(TabContents* tab_contents,
const GURL& url)
: creation_time_(base::Time::Now()),
scheme_(UTF8ToWide(url.scheme())) {
+ const int kMaxUrlWithoutSchemeSize = 256;
+ std::wstring elided_url_without_scheme;
+ ElideString(ASCIIToWide(url.possibly_invalid_spec()),
+ kMaxUrlWithoutSchemeSize, &elided_url_without_scheme);
+
std::wstring message_text = l10n_util::GetStringF(
IDS_EXTERNAL_PROTOCOL_INFORMATION,
ASCIIToWide(url.scheme() + ":"),
- ASCIIToWide(url.possibly_invalid_spec())) + L"\n\n";
+ elided_url_without_scheme) + L"\n\n";
message_box_view_ = new MessageBoxView(MessageBoxFlags::kIsConfirmMessageBox,
message_text,