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

Side by Side Diff: chrome/browser/tab_contents/navigation_entry.cc

Issue 165485: Renames the NavigationEntry::display_url() to virtual_url(). (Closed)
Patch Set: Created 11 years, 4 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
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/resource_bundle.h" 7 #include "app/resource_bundle.h"
8 #include "chrome/browser/profile.h" 8 #include "chrome/browser/profile.h"
9 #include "chrome/browser/tab_contents/navigation_controller.h" 9 #include "chrome/browser/tab_contents/navigation_controller.h"
10 #include "chrome/common/pref_names.h" 10 #include "chrome/common/pref_names.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 // Most pages have real titles. Don't even bother caching anything if this is 67 // Most pages have real titles. Don't even bother caching anything if this is
68 // the case. 68 // the case.
69 if (!title_.empty()) 69 if (!title_.empty())
70 return title_; 70 return title_;
71 71
72 // More complicated cases will use the URLs as the title. This result we will 72 // More complicated cases will use the URLs as the title. This result we will
73 // cache since it's more complicated to compute. 73 // cache since it's more complicated to compute.
74 if (!cached_display_title_.empty()) 74 if (!cached_display_title_.empty())
75 return cached_display_title_; 75 return cached_display_title_;
76 76
77 // Use the display URL first if any, and fall back on using the real URL. 77 // Use the virtual URL first if any, and fall back on using the real URL.
78 std::wstring languages; 78 std::wstring languages;
79 if (navigation_controller) { 79 if (navigation_controller) {
80 languages = navigation_controller->profile()->GetPrefs()->GetString( 80 languages = navigation_controller->profile()->GetPrefs()->GetString(
81 prefs::kAcceptLanguages); 81 prefs::kAcceptLanguages);
82 } 82 }
83 if (!display_url_.is_empty()) { 83 if (!virtual_url_.is_empty()) {
84 cached_display_title_ = WideToUTF16Hack(net::FormatUrl( 84 cached_display_title_ = WideToUTF16Hack(net::FormatUrl(
85 display_url_, languages)); 85 virtual_url_, languages));
86 } else if (!url_.is_empty()) { 86 } else if (!url_.is_empty()) {
87 cached_display_title_ = WideToUTF16Hack(net::FormatUrl(url_, languages)); 87 cached_display_title_ = WideToUTF16Hack(net::FormatUrl(url_, languages));
88 } 88 }
89 return cached_display_title_; 89 return cached_display_title_;
90 } 90 }
91 91
92 bool NavigationEntry::IsViewSourceMode() const { 92 bool NavigationEntry::IsViewSourceMode() const {
93 return display_url_.SchemeIs(chrome::kViewSourceScheme); 93 return virtual_url_.SchemeIs(chrome::kViewSourceScheme);
94 } 94 }
OLDNEW
« no previous file with comments | « chrome/browser/tab_contents/navigation_entry.h ('k') | chrome/browser/tab_contents/navigation_entry_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698