| OLD | NEW |
| 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.h" | 5 #include "chrome/browser/tab_contents.h" |
| 6 | 6 |
| 7 #include "chrome/browser/cert_store.h" | 7 #include "chrome/browser/cert_store.h" |
| 8 #include "chrome/browser/navigation_entry.h" | 8 #include "chrome/browser/navigation_entry.h" |
| 9 #include "chrome/browser/views/download_shelf_view.h" | 9 #include "chrome/browser/views/download_shelf_view.h" |
| 10 #include "chrome/browser/views/download_started_animation.h" | 10 #include "chrome/browser/views/download_started_animation.h" |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 } | 124 } |
| 125 | 125 |
| 126 const std::wstring& TabContents::GetTitle() const { | 126 const std::wstring& TabContents::GetTitle() const { |
| 127 // We use the title for the last committed entry rather than a pending | 127 // We use the title for the last committed entry rather than a pending |
| 128 // navigation entry. For example, when the user types in a URL, we want to | 128 // navigation entry. For example, when the user types in a URL, we want to |
| 129 // keep the old page's title until the new load has committed and we get a new | 129 // keep the old page's title until the new load has committed and we get a new |
| 130 // title. | 130 // title. |
| 131 // The exception is with transient pages, for which we really want to use | 131 // The exception is with transient pages, for which we really want to use |
| 132 // their title, as they are not committed. | 132 // their title, as they are not committed. |
| 133 NavigationEntry* entry = controller_->GetTransientEntry(); | 133 NavigationEntry* entry = controller_->GetTransientEntry(); |
| 134 if (entry && !entry->title().empty()) | 134 if (entry) |
| 135 return entry->title(); | 135 return entry->GetTitleForDisplay(); |
| 136 | 136 |
| 137 entry = controller_->GetLastCommittedEntry(); | 137 entry = controller_->GetLastCommittedEntry(); |
| 138 if (entry) | 138 if (entry) |
| 139 return entry->title(); | 139 return entry->GetTitleForDisplay(); |
| 140 else if (controller_->LoadingURLLazily()) | 140 else if (controller_->LoadingURLLazily()) |
| 141 return controller_->GetLazyTitle(); | 141 return controller_->GetLazyTitle(); |
| 142 return EmptyWString(); | 142 return EmptyWString(); |
| 143 } | 143 } |
| 144 | 144 |
| 145 int32 TabContents::GetMaxPageID() { | 145 int32 TabContents::GetMaxPageID() { |
| 146 if (GetSiteInstance()) | 146 if (GetSiteInstance()) |
| 147 return GetSiteInstance()->max_page_id(); | 147 return GetSiteInstance()->max_page_id(); |
| 148 else | 148 else |
| 149 return max_page_id_; | 149 return max_page_id_; |
| (...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 535 for (int i = window_count - 1; i >= 0; --i) { | 535 for (int i = window_count - 1; i >= 0; --i) { |
| 536 ConstrainedWindow* window = child_windows_.at(i); | 536 ConstrainedWindow* window = child_windows_.at(i); |
| 537 if (window->IsSuppressedConstrainedWindow()) | 537 if (window->IsSuppressedConstrainedWindow()) |
| 538 window->RepositionConstrainedWindowTo(anchor_position); | 538 window->RepositionConstrainedWindowTo(anchor_position); |
| 539 } | 539 } |
| 540 } | 540 } |
| 541 | 541 |
| 542 void TabContents::ReleaseDownloadShelfView() { | 542 void TabContents::ReleaseDownloadShelfView() { |
| 543 download_shelf_view_.release(); | 543 download_shelf_view_.release(); |
| 544 } | 544 } |
| OLD | NEW |