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

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

Issue 7790018: Don't update URL bar or SSL icon for pending history navs until they commit. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update comment. Created 9 years, 3 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
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_controller.h" 5 #include "content/browser/tab_contents/navigation_controller.h"
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "base/time.h" 10 #include "base/time.h"
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 } 278 }
279 279
280 NavigationEntry* NavigationController::GetActiveEntry() const { 280 NavigationEntry* NavigationController::GetActiveEntry() const {
281 if (transient_entry_index_ != -1) 281 if (transient_entry_index_ != -1)
282 return entries_[transient_entry_index_].get(); 282 return entries_[transient_entry_index_].get();
283 if (pending_entry_) 283 if (pending_entry_)
284 return pending_entry_; 284 return pending_entry_;
285 return GetLastCommittedEntry(); 285 return GetLastCommittedEntry();
286 } 286 }
287 287
288 NavigationEntry* NavigationController::GetVisibleEntry() const {
289 if (transient_entry_index_ != -1)
290 return entries_[transient_entry_index_].get();
291 // Only return pending_entry for new navigations.
292 if (pending_entry_ && pending_entry_->page_id() == -1)
293 return pending_entry_;
294 return GetLastCommittedEntry();
295 }
296
288 int NavigationController::GetCurrentEntryIndex() const { 297 int NavigationController::GetCurrentEntryIndex() const {
289 if (transient_entry_index_ != -1) 298 if (transient_entry_index_ != -1)
290 return transient_entry_index_; 299 return transient_entry_index_;
291 if (pending_entry_index_ != -1) 300 if (pending_entry_index_ != -1)
292 return pending_entry_index_; 301 return pending_entry_index_;
293 return last_committed_entry_index_; 302 return last_committed_entry_index_;
294 } 303 }
295 304
296 NavigationEntry* NavigationController::GetLastCommittedEntry() const { 305 NavigationEntry* NavigationController::GetLastCommittedEntry() const {
297 if (last_committed_entry_index_ == -1) 306 if (last_committed_entry_index_ == -1)
(...skipping 892 matching lines...) Expand 10 before | Expand all | Expand 10 after
1190 size_t insert_index = 0; 1199 size_t insert_index = 0;
1191 for (int i = 0; i < max_index; i++) { 1200 for (int i = 0; i < max_index; i++) {
1192 // When cloning a tab, copy all entries except interstitial pages 1201 // When cloning a tab, copy all entries except interstitial pages
1193 if (source.entries_[i].get()->page_type() != INTERSTITIAL_PAGE) { 1202 if (source.entries_[i].get()->page_type() != INTERSTITIAL_PAGE) {
1194 entries_.insert(entries_.begin() + insert_index++, 1203 entries_.insert(entries_.begin() + insert_index++,
1195 linked_ptr<NavigationEntry>( 1204 linked_ptr<NavigationEntry>(
1196 new NavigationEntry(*source.entries_[i]))); 1205 new NavigationEntry(*source.entries_[i])));
1197 } 1206 }
1198 } 1207 }
1199 } 1208 }
OLDNEW
« no previous file with comments | « content/browser/tab_contents/navigation_controller.h ('k') | content/browser/tab_contents/navigation_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698