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

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

Issue 39022: Convert NavigationEntry title to string16. TabContents::GetTitle no longer ne... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/tab_contents/tab_contents.h ('k') | chrome/browser/tab_contents/web_contents.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 #if defined(OS_WIN) 5 #if defined(OS_WIN)
6 #include "chrome/browser/tab_contents/tab_contents.h" 6 #include "chrome/browser/tab_contents/tab_contents.h"
7 #elif defined(OS_POSIX) 7 #elif defined(OS_POSIX)
8 #include "chrome/common/temp_scaffolding_stubs.h" 8 #include "chrome/common/temp_scaffolding_stubs.h"
9 #endif 9 #endif
10 10
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 } 142 }
143 return false; 143 return false;
144 } 144 }
145 145
146 const GURL& TabContents::GetURL() const { 146 const GURL& TabContents::GetURL() const {
147 // We may not have a navigation entry yet 147 // We may not have a navigation entry yet
148 NavigationEntry* entry = controller_->GetActiveEntry(); 148 NavigationEntry* entry = controller_->GetActiveEntry();
149 return entry ? entry->display_url() : GURL::EmptyGURL(); 149 return entry ? entry->display_url() : GURL::EmptyGURL();
150 } 150 }
151 151
152 const std::wstring& TabContents::GetTitle() const { 152 const string16& TabContents::GetTitle() const {
153 // We use the title for the last committed entry rather than a pending 153 // We use the title for the last committed entry rather than a pending
154 // navigation entry. For example, when the user types in a URL, we want to 154 // navigation entry. For example, when the user types in a URL, we want to
155 // keep the old page's title until the new load has committed and we get a new 155 // keep the old page's title until the new load has committed and we get a new
156 // title. 156 // title.
157 // The exception is with transient pages, for which we really want to use 157 // The exception is with transient pages, for which we really want to use
158 // their title, as they are not committed. 158 // their title, as they are not committed.
159 NavigationEntry* entry = controller_->GetTransientEntry(); 159 NavigationEntry* entry = controller_->GetTransientEntry();
160 if (entry) 160 if (entry)
161 return entry->GetTitleForDisplay(); 161 return entry->GetTitleForDisplay(controller_);
162 162
163 entry = controller_->GetLastCommittedEntry(); 163 entry = controller_->GetLastCommittedEntry();
164 if (entry) 164 if (entry)
165 return entry->GetTitleForDisplay(); 165 return entry->GetTitleForDisplay(controller_);
166 else if (controller_->LoadingURLLazily()) 166 else if (controller_->LoadingURLLazily())
167 return controller_->GetLazyTitle(); 167 return controller_->GetLazyTitle();
168 return EmptyWString(); 168 return EmptyString16();
169 } 169 }
170 170
171 int32 TabContents::GetMaxPageID() { 171 int32 TabContents::GetMaxPageID() {
172 if (GetSiteInstance()) 172 if (GetSiteInstance())
173 return GetSiteInstance()->max_page_id(); 173 return GetSiteInstance()->max_page_id();
174 else 174 else
175 return max_page_id_; 175 return max_page_id_;
176 } 176 }
177 177
178 void TabContents::UpdateMaxPageID(int32 page_id) { 178 void TabContents::UpdateMaxPageID(int32 page_id) {
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after
627 if (!details.is_user_initiated_main_frame_load()) 627 if (!details.is_user_initiated_main_frame_load())
628 return; 628 return;
629 629
630 for (int i = infobar_delegate_count() - 1; i >= 0; --i) { 630 for (int i = infobar_delegate_count() - 1; i >= 0; --i) {
631 InfoBarDelegate* delegate = GetInfoBarDelegateAt(i); 631 InfoBarDelegate* delegate = GetInfoBarDelegateAt(i);
632 if (delegate->ShouldExpire(details)) 632 if (delegate->ShouldExpire(details))
633 RemoveInfoBar(delegate); 633 RemoveInfoBar(delegate);
634 } 634 }
635 } 635 }
636 #endif // defined(OS_WIN) 636 #endif // defined(OS_WIN)
OLDNEW
« no previous file with comments | « chrome/browser/tab_contents/tab_contents.h ('k') | chrome/browser/tab_contents/web_contents.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698