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

Side by Side Diff: chrome/browser/tab_contents/navigation_entry.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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/net/url_fixer_upper.cc ('k') | chrome/browser/toolbar_model.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/tab_contents/navigation_entry.h" 5 #include "chrome/browser/tab_contents/navigation_entry.h"
6 6
7 #include "app/gfx/text_elider.h"
8 #include "app/resource_bundle.h" 7 #include "app/resource_bundle.h"
9 #include "chrome/browser/tab_contents/navigation_controller.h" 8 #include "chrome/browser/tab_contents/navigation_controller.h"
10 #include "chrome/common/pref_names.h" 9 #include "chrome/common/pref_names.h"
11 #include "chrome/common/pref_service.h" 10 #include "chrome/common/pref_service.h"
12 #include "chrome/common/url_constants.h" 11 #include "chrome/common/url_constants.h"
12 #include "net/base/net_util.h"
13 13
14 // Use this to get a new unique ID for a NavigationEntry during construction. 14 // Use this to get a new unique ID for a NavigationEntry during construction.
15 // The returned ID is guaranteed to be nonzero (which is the "no ID" indicator). 15 // The returned ID is guaranteed to be nonzero (which is the "no ID" indicator).
16 static int GetUniqueID() { 16 static int GetUniqueID() {
17 static int unique_id_counter = 0; 17 static int unique_id_counter = 0;
18 return ++unique_id_counter; 18 return ++unique_id_counter;
19 } 19 }
20 20
21 NavigationEntry::SSLStatus::SSLStatus() 21 NavigationEntry::SSLStatus::SSLStatus()
22 : security_style_(SECURITY_STYLE_UNKNOWN), 22 : security_style_(SECURITY_STYLE_UNKNOWN),
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 if (!cached_display_title_.empty()) 72 if (!cached_display_title_.empty())
73 return cached_display_title_; 73 return cached_display_title_;
74 74
75 // Use the display URL first if any, and fall back on using the real URL. 75 // Use the display URL first if any, and fall back on using the real URL.
76 std::wstring languages; 76 std::wstring languages;
77 if (navigation_controller) { 77 if (navigation_controller) {
78 languages = navigation_controller->profile()->GetPrefs()->GetString( 78 languages = navigation_controller->profile()->GetPrefs()->GetString(
79 prefs::kAcceptLanguages); 79 prefs::kAcceptLanguages);
80 } 80 }
81 if (!display_url_.is_empty()) { 81 if (!display_url_.is_empty()) {
82 cached_display_title_ = WideToUTF16Hack(gfx::GetCleanStringFromUrl( 82 cached_display_title_ = WideToUTF16Hack(net::FormatUrl(
83 display_url_, languages, NULL, NULL)); 83 display_url_, languages));
84 } else if (!url_.is_empty()) { 84 } else if (!url_.is_empty()) {
85 cached_display_title_ = WideToUTF16Hack(gfx::GetCleanStringFromUrl( 85 cached_display_title_ = WideToUTF16Hack(net::FormatUrl(url_, languages));
86 url_, languages, NULL, NULL));
87 } 86 }
88 return cached_display_title_; 87 return cached_display_title_;
89 } 88 }
90 89
91 bool NavigationEntry::IsViewSourceMode() const { 90 bool NavigationEntry::IsViewSourceMode() const {
92 return display_url_.SchemeIs(chrome::kViewSourceScheme); 91 return display_url_.SchemeIs(chrome::kViewSourceScheme);
93 } 92 }
OLDNEW
« no previous file with comments | « chrome/browser/net/url_fixer_upper.cc ('k') | chrome/browser/toolbar_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698