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

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

Issue 7453053: history: use display title, not page title (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: const Created 9 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 | Annotate | Revision Log
« no previous file with comments | « content/browser/tab_contents/navigation_entry.h ('k') | no next file » | 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "content/browser/tab_contents/navigation_entry.h" 5 #include "content/browser/tab_contents/navigation_entry.h"
6 6
7 #include "base/string_util.h" 7 #include "base/string_util.h"
8 #include "base/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #include "content/browser/content_browser_client.h" 9 #include "content/browser/content_browser_client.h"
10 #include "content/browser/site_instance.h" 10 #include "content/browser/site_instance.h"
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 } 65 }
66 66
67 NavigationEntry::~NavigationEntry() { 67 NavigationEntry::~NavigationEntry() {
68 } 68 }
69 69
70 void NavigationEntry::set_site_instance(SiteInstance* site_instance) { 70 void NavigationEntry::set_site_instance(SiteInstance* site_instance) {
71 site_instance_ = site_instance; 71 site_instance_ = site_instance;
72 } 72 }
73 73
74 const string16& NavigationEntry::GetTitleForDisplay( 74 const string16& NavigationEntry::GetTitleForDisplay(
75 const std::string& languages) { 75 const std::string& languages) const {
76 // Most pages have real titles. Don't even bother caching anything if this is 76 // Most pages have real titles. Don't even bother caching anything if this is
77 // the case. 77 // the case.
78 if (!title_.empty()) 78 if (!title_.empty())
79 return title_; 79 return title_;
80 80
81 // More complicated cases will use the URLs as the title. This result we will 81 // More complicated cases will use the URLs as the title. This result we will
82 // cache since it's more complicated to compute. 82 // cache since it's more complicated to compute.
83 if (!cached_display_title_.empty()) 83 if (!cached_display_title_.empty())
84 return cached_display_title_; 84 return cached_display_title_;
85 85
(...skipping 12 matching lines...) Expand all
98 title = title.substr(slashpos + 1); 98 title = title.substr(slashpos + 1);
99 } 99 }
100 100
101 ui::ElideString(title, content::kMaxTitleChars, &cached_display_title_); 101 ui::ElideString(title, content::kMaxTitleChars, &cached_display_title_);
102 return cached_display_title_; 102 return cached_display_title_;
103 } 103 }
104 104
105 bool NavigationEntry::IsViewSourceMode() const { 105 bool NavigationEntry::IsViewSourceMode() const {
106 return virtual_url_.SchemeIs(chrome::kViewSourceScheme); 106 return virtual_url_.SchemeIs(chrome::kViewSourceScheme);
107 } 107 }
OLDNEW
« no previous file with comments | « content/browser/tab_contents/navigation_entry.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698