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

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

Issue 2619063003: Update viewport_meta setting on any navigation. (Closed)
Patch Set: Reupload patch set 1 Created 3 years, 11 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 /* 5 /*
6 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 6 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
7 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 7 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved.
9 * (http://www.torchmobile.com/) 9 * (http://www.torchmobile.com/)
10 * 10 *
(...skipping 785 matching lines...) Expand 10 before | Expand all | Expand 10 after
796 796
797 bool NavigationControllerImpl::RendererDidNavigate( 797 bool NavigationControllerImpl::RendererDidNavigate(
798 RenderFrameHostImpl* rfh, 798 RenderFrameHostImpl* rfh,
799 const FrameHostMsg_DidCommitProvisionalLoad_Params& params, 799 const FrameHostMsg_DidCommitProvisionalLoad_Params& params,
800 LoadCommittedDetails* details, 800 LoadCommittedDetails* details,
801 bool is_navigation_within_page, 801 bool is_navigation_within_page,
802 NavigationHandleImpl* navigation_handle) { 802 NavigationHandleImpl* navigation_handle) {
803 is_initial_navigation_ = false; 803 is_initial_navigation_ = false;
804 804
805 // Save the previous state before we clobber it. 805 // Save the previous state before we clobber it.
806 bool overriding_user_agent_changed = false;
806 if (GetLastCommittedEntry()) { 807 if (GetLastCommittedEntry()) {
807 details->previous_url = GetLastCommittedEntry()->GetURL(); 808 details->previous_url = GetLastCommittedEntry()->GetURL();
808 details->previous_entry_index = GetLastCommittedEntryIndex(); 809 details->previous_entry_index = GetLastCommittedEntryIndex();
810 if (pending_entry_ &&
Charlie Reis 2017/01/12 17:45:59 I don't think you can remove this check. Plenty o
aelias_OOO_until_Jul13 2017/01/12 19:27:30 Right, that removal was a text editing mistake, so
811 pending_entry_->GetIsOverridingUserAgent() !=
812 GetLastCommittedEntry()->GetIsOverridingUserAgent())
813 overriding_user_agent_changed = true;
809 } else { 814 } else {
810 details->previous_url = GURL(); 815 details->previous_url = GURL();
811 details->previous_entry_index = -1; 816 details->previous_entry_index = -1;
812 } 817 }
813 818
814 // If there is a pending entry at this point, it should have a SiteInstance, 819 // If there is a pending entry at this point, it should have a SiteInstance,
815 // except for restored entries. 820 // except for restored entries.
816 DCHECK(pending_entry_index_ == -1 || pending_entry_->site_instance() || 821 DCHECK(pending_entry_index_ == -1 || pending_entry_->site_instance() ||
817 pending_entry_->restore_type() != RestoreType::NONE); 822 pending_entry_->restore_type() != RestoreType::NONE);
818 if (pending_entry_ && pending_entry_->restore_type() != RestoreType::NONE) { 823 if (pending_entry_ && pending_entry_->restore_type() != RestoreType::NONE) {
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
946 // we do not grant this entry additional bindings if we come back to it. 951 // we do not grant this entry additional bindings if we come back to it.
947 active_entry->SetBindings(rfh->GetEnabledBindings()); 952 active_entry->SetBindings(rfh->GetEnabledBindings());
948 953
949 // Now prep the rest of the details for the notification and broadcast. 954 // Now prep the rest of the details for the notification and broadcast.
950 details->entry = active_entry; 955 details->entry = active_entry;
951 details->is_main_frame = !rfh->GetParent(); 956 details->is_main_frame = !rfh->GetParent();
952 details->http_status_code = params.http_status_code; 957 details->http_status_code = params.http_status_code;
953 958
954 NotifyNavigationEntryCommitted(details); 959 NotifyNavigationEntryCommitted(details);
955 960
961 if (overriding_user_agent_changed)
962 delegate_->UpdateOverridingUserAgent();
963
956 // Update the nav_entry_id for each RenderFrameHost in the tree, so that each 964 // Update the nav_entry_id for each RenderFrameHost in the tree, so that each
957 // one knows the latest NavigationEntry it is showing (whether it has 965 // one knows the latest NavigationEntry it is showing (whether it has
958 // committed anything in this navigation or not). This allows things like 966 // committed anything in this navigation or not). This allows things like
959 // state and title updates from RenderFrames to apply to the latest relevant 967 // state and title updates from RenderFrames to apply to the latest relevant
960 // NavigationEntry. 968 // NavigationEntry.
961 int nav_entry_id = active_entry->GetUniqueID(); 969 int nav_entry_id = active_entry->GetUniqueID();
962 for (FrameTreeNode* node : delegate_->GetFrameTree()->Nodes()) 970 for (FrameTreeNode* node : delegate_->GetFrameTree()->Nodes())
963 node->current_frame_host()->set_nav_entry_id(nav_entry_id); 971 node->current_frame_host()->set_nav_entry_id(nav_entry_id);
964 return true; 972 return true;
965 } 973 }
(...skipping 1187 matching lines...) Expand 10 before | Expand all | Expand 10 after
2153 } 2161 }
2154 } 2162 }
2155 } 2163 }
2156 2164
2157 void NavigationControllerImpl::SetGetTimestampCallbackForTest( 2165 void NavigationControllerImpl::SetGetTimestampCallbackForTest(
2158 const base::Callback<base::Time()>& get_timestamp_callback) { 2166 const base::Callback<base::Time()>& get_timestamp_callback) {
2159 get_timestamp_callback_ = get_timestamp_callback; 2167 get_timestamp_callback_ = get_timestamp_callback;
2160 } 2168 }
2161 2169
2162 } // namespace content 2170 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698