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

Unified Diff: chrome/browser/tab_contents/navigation_entry.cc

Issue 1569011: Make the browser survive massive data: URIs, via various techniques:... (Closed) Base URL: svn://chrome-svn.corp.google.com/chrome/trunk/src/
Patch Set: '' Created 10 years, 9 months 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 | « no previous file | chrome/browser/toolbar_model.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/tab_contents/navigation_entry.cc
===================================================================
--- chrome/browser/tab_contents/navigation_entry.cc (revision 43077)
+++ chrome/browser/tab_contents/navigation_entry.cc (working copy)
@@ -5,11 +5,13 @@
#include "chrome/browser/tab_contents/navigation_entry.h"
#include "app/resource_bundle.h"
+#include "base/string_util.h"
#include "base/utf_string_conversions.h"
#include "chrome/browser/pref_service.h"
#include "chrome/browser/profile.h"
#include "chrome/browser/renderer_host/site_instance.h"
#include "chrome/browser/tab_contents/navigation_controller.h"
+#include "chrome/common/chrome_constants.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/url_constants.h"
#include "grit/app_resources.h"
@@ -91,12 +93,16 @@
languages = navigation_controller->profile()->GetPrefs()->GetString(
prefs::kAcceptLanguages);
}
+
+ std::wstring title;
+ std::wstring elided_title;
if (!virtual_url_.is_empty()) {
- cached_display_title_ = WideToUTF16Hack(net::FormatUrl(
- virtual_url_, languages));
+ title = net::FormatUrl(virtual_url_, languages);
} else if (!url_.is_empty()) {
- cached_display_title_ = WideToUTF16Hack(net::FormatUrl(url_, languages));
+ title = net::FormatUrl(url_, languages);
}
+ ElideString(title, chrome::kMaxTitleChars, &elided_title);
+ cached_display_title_ = WideToUTF16Hack(elided_title);
return cached_display_title_;
}
« no previous file with comments | « no previous file | chrome/browser/toolbar_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698