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

Unified Diff: chrome/browser/views/bookmark_editor_view.cc

Issue 115346: Convert Punycode domains to Unicode in URLs shown in the followings:... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 years, 7 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 | « chrome/browser/toolbar_model.cc ('k') | net/base/net_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/views/bookmark_editor_view.cc
===================================================================
--- chrome/browser/views/bookmark_editor_view.cc (revision 16437)
+++ chrome/browser/views/bookmark_editor_view.cc (working copy)
@@ -12,10 +12,13 @@
#include "chrome/browser/history/history.h"
#include "chrome/browser/profile.h"
#include "chrome/browser/net/url_fixer_upper.h"
+#include "chrome/common/pref_names.h"
+#include "chrome/common/pref_service.h"
#include "googleurl/src/gurl.h"
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
#include "grit/locale_settings.h"
+#include "net/base/net_util.h"
#include "views/background.h"
#include "views/focus/focus_manager.h"
#include "views/grid_layout.h"
@@ -246,7 +249,17 @@
title_tf_.SetText(node_ ? node_->GetTitle() : std::wstring());
title_tf_.SetController(this);
- url_tf_.SetText(node_ ? UTF8ToWide(node_->GetURL().spec()) : std::wstring());
+ std::wstring url_text;
+ if (node_) {
+ std::wstring languages = profile_
+ ? profile_->GetPrefs()->GetString(prefs::kAcceptLanguages)
+ : std::wstring();
+ // The following URL is user-editable. We specify omit_username_password=
+ // false and unescape=false to show the original URL except IDN.
+ url_text =
+ net::FormatUrl(node_->GetURL(), languages, false, false, NULL, NULL);
+ }
+ url_tf_.SetText(url_text);
url_tf_.SetController(this);
if (show_tree_) {
« no previous file with comments | « chrome/browser/toolbar_model.cc ('k') | net/base/net_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698