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

Side by Side Diff: content/browser/frame_host/navigation_controller_impl.cc

Issue 1010243002: PlzNavigate: Properly set the pending entry in the NavigatorImpl unit test. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: better approach Created 5 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/frame_host/navigation_controller_impl.h" 5 #include "content/browser/frame_host/navigation_controller_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after
418 // When navigating to a new page, we don't know for sure if we will actually 418 // When navigating to a new page, we don't know for sure if we will actually
419 // end up leaving the current page. The new page load could for example 419 // end up leaving the current page. The new page load could for example
420 // result in a download or a 'no content' response (e.g., a mailto: URL). 420 // result in a download or a 'no content' response (e.g., a mailto: URL).
421 SetPendingEntry(entry); 421 SetPendingEntry(entry);
422 NavigateToPendingEntry(NO_RELOAD); 422 NavigateToPendingEntry(NO_RELOAD);
423 } 423 }
424 424
425 void NavigationControllerImpl::SetPendingEntry(NavigationEntryImpl* entry) { 425 void NavigationControllerImpl::SetPendingEntry(NavigationEntryImpl* entry) {
426 DiscardNonCommittedEntriesInternal(); 426 DiscardNonCommittedEntriesInternal();
427 pending_entry_ = entry; 427 pending_entry_ = entry;
428 pending_entry_index_ = GetIndexOfEntry(entry);
Charlie Reis 2015/03/18 20:26:35 Interesting that we didn't need this before, but I
Avi (use Gerrit) 2015/03/18 20:32:42 Yep.
428 NotificationService::current()->Notify( 429 NotificationService::current()->Notify(
429 NOTIFICATION_NAV_ENTRY_PENDING, 430 NOTIFICATION_NAV_ENTRY_PENDING,
430 Source<NavigationController>(this), 431 Source<NavigationController>(this),
431 Details<NavigationEntry>(entry)); 432 Details<NavigationEntry>(entry));
432 } 433 }
433 434
434 NavigationEntryImpl* NavigationControllerImpl::GetActiveEntry() const { 435 NavigationEntryImpl* NavigationControllerImpl::GetActiveEntry() const {
435 if (transient_entry_index_ != -1) 436 if (transient_entry_index_ != -1)
436 return entries_[transient_entry_index_].get(); 437 return entries_[transient_entry_index_].get();
437 if (pending_entry_) 438 if (pending_entry_)
(...skipping 1377 matching lines...) Expand 10 before | Expand all | Expand 10 after
1815 } 1816 }
1816 } 1817 }
1817 } 1818 }
1818 1819
1819 void NavigationControllerImpl::SetGetTimestampCallbackForTest( 1820 void NavigationControllerImpl::SetGetTimestampCallbackForTest(
1820 const base::Callback<base::Time()>& get_timestamp_callback) { 1821 const base::Callback<base::Time()>& get_timestamp_callback) {
1821 get_timestamp_callback_ = get_timestamp_callback; 1822 get_timestamp_callback_ = get_timestamp_callback;
1822 } 1823 }
1823 1824
1824 } // namespace content 1825 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698