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

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

Issue 308143004: Immediately SetTitle on a new NavigationEntry created via history.pushState (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 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/debug/trace_event.h" 9 #include "base/debug/trace_event.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 1039 matching lines...) Expand 10 before | Expand all | Expand 10 after
1050 new_entry->SetReferrer(params.referrer); 1050 new_entry->SetReferrer(params.referrer);
1051 new_entry->SetPageID(params.page_id); 1051 new_entry->SetPageID(params.page_id);
1052 new_entry->SetTransitionType(params.transition); 1052 new_entry->SetTransitionType(params.transition);
1053 new_entry->set_site_instance( 1053 new_entry->set_site_instance(
1054 static_cast<SiteInstanceImpl*>(rfh->GetSiteInstance())); 1054 static_cast<SiteInstanceImpl*>(rfh->GetSiteInstance()));
1055 new_entry->SetHasPostData(params.is_post); 1055 new_entry->SetHasPostData(params.is_post);
1056 new_entry->SetPostID(params.post_id); 1056 new_entry->SetPostID(params.post_id);
1057 new_entry->SetOriginalRequestURL(params.original_request_url); 1057 new_entry->SetOriginalRequestURL(params.original_request_url);
1058 new_entry->SetIsOverridingUserAgent(params.is_overriding_user_agent); 1058 new_entry->SetIsOverridingUserAgent(params.is_overriding_user_agent);
1059 1059
1060 // history.pushState() is classified as a navigation to a new page, but
1061 // sets was_within_same_page to true. In this case, we alraedy have the
nasko 2014/05/30 19:04:55 nit: already
Nate Chapin 2014/05/30 19:10:05 Done.
1062 // title available, so set it immediately.
1063 if (params.was_within_same_page)
1064 new_entry->SetTitle(GetLastCommittedEntry()->GetTitle());
1065
1060 DCHECK(!params.history_list_was_cleared || !replace_entry); 1066 DCHECK(!params.history_list_was_cleared || !replace_entry);
1061 // The browser requested to clear the session history when it initiated the 1067 // The browser requested to clear the session history when it initiated the
1062 // navigation. Now we know that the renderer has updated its state accordingly 1068 // navigation. Now we know that the renderer has updated its state accordingly
1063 // and it is safe to also clear the browser side history. 1069 // and it is safe to also clear the browser side history.
1064 if (params.history_list_was_cleared) { 1070 if (params.history_list_was_cleared) {
1065 DiscardNonCommittedEntriesInternal(); 1071 DiscardNonCommittedEntriesInternal();
1066 entries_.clear(); 1072 entries_.clear();
1067 last_committed_entry_index_ = -1; 1073 last_committed_entry_index_ = -1;
1068 } 1074 }
1069 1075
(...skipping 691 matching lines...) Expand 10 before | Expand all | Expand 10 after
1761 } 1767 }
1762 } 1768 }
1763 } 1769 }
1764 1770
1765 void NavigationControllerImpl::SetGetTimestampCallbackForTest( 1771 void NavigationControllerImpl::SetGetTimestampCallbackForTest(
1766 const base::Callback<base::Time()>& get_timestamp_callback) { 1772 const base::Callback<base::Time()>& get_timestamp_callback) {
1767 get_timestamp_callback_ = get_timestamp_callback; 1773 get_timestamp_callback_ = get_timestamp_callback;
1768 } 1774 }
1769 1775
1770 } // namespace content 1776 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698