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

Side by Side Diff: content/browser/web_contents/web_contents_impl.cc

Issue 1425293006: Move nav_entry_id from RenderViewHost to RenderFrameHost. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Initial patch Created 5 years, 1 month 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 | « content/browser/renderer_host/render_view_host_impl.cc ('k') | 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/web_contents/web_contents_impl.h" 5 #include "content/browser/web_contents/web_contents_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 3872 matching lines...) Expand 10 before | Expand all | Expand 10 after
3883 // leaving a page, in which case our state may have already been moved to 3883 // leaving a page, in which case our state may have already been moved to
3884 // the next page. The navigation controller will look up the appropriate 3884 // the next page. The navigation controller will look up the appropriate
3885 // NavigationEntry and update it when it is notified via the delegate. 3885 // NavigationEntry and update it when it is notified via the delegate.
3886 RenderViewHostImpl* rvhi = static_cast<RenderViewHostImpl*>(rvh); 3886 RenderViewHostImpl* rvhi = static_cast<RenderViewHostImpl*>(rvh);
3887 NavigationEntryImpl* entry = controller_.GetEntryWithPageID( 3887 NavigationEntryImpl* entry = controller_.GetEntryWithPageID(
3888 rvhi->GetSiteInstance(), page_id); 3888 rvhi->GetSiteInstance(), page_id);
3889 if (!entry) 3889 if (!entry)
3890 return; 3890 return;
3891 3891
3892 NavigationEntryImpl* new_entry = controller_.GetEntryWithUniqueID( 3892 NavigationEntryImpl* new_entry = controller_.GetEntryWithUniqueID(
3893 rvhi->nav_entry_id()); 3893 static_cast<RenderFrameHostImpl*>(rvhi->GetMainFrame())->nav_entry_id());
3894 3894
3895 if (SiteIsolationPolicy::UseSubframeNavigationEntries()) { 3895 if (SiteIsolationPolicy::UseSubframeNavigationEntries()) {
3896 // TODO(creis): We can't properly update state for cross-process subframes 3896 // TODO(creis): We can't properly update state for cross-process subframes
3897 // until PageState is decomposed into FrameStates. Until then, use the new 3897 // until PageState is decomposed into FrameStates. Until then, use the new
3898 // method. 3898 // method.
3899 entry = new_entry; 3899 entry = new_entry;
3900 } else { 3900 } else {
3901 DCHECK_EQ(entry, new_entry); 3901 DCHECK_EQ(entry, new_entry);
3902 } 3902 }
3903 3903
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
4067 base::i18n::TextDirection title_direction) { 4067 base::i18n::TextDirection title_direction) {
4068 // If we have a title, that's a pretty good indication that we've started 4068 // If we have a title, that's a pretty good indication that we've started
4069 // getting useful data. 4069 // getting useful data.
4070 SetNotWaitingForResponse(); 4070 SetNotWaitingForResponse();
4071 4071
4072 // Try to find the navigation entry, which might not be the current one. 4072 // Try to find the navigation entry, which might not be the current one.
4073 // For example, it might be from a recently swapped out RFH. 4073 // For example, it might be from a recently swapped out RFH.
4074 NavigationEntryImpl* entry = controller_.GetEntryWithPageID( 4074 NavigationEntryImpl* entry = controller_.GetEntryWithPageID(
4075 render_frame_host->GetSiteInstance(), page_id); 4075 render_frame_host->GetSiteInstance(), page_id);
4076 4076
4077 RenderViewHostImpl* rvhi =
4078 static_cast<RenderViewHostImpl*>(render_frame_host->GetRenderViewHost());
4079 NavigationEntryImpl* new_entry = controller_.GetEntryWithUniqueID( 4077 NavigationEntryImpl* new_entry = controller_.GetEntryWithUniqueID(
4080 rvhi->nav_entry_id()); 4078 static_cast<RenderFrameHostImpl*>(render_frame_host)->nav_entry_id());
4081 DCHECK_EQ(entry, new_entry); 4079 DCHECK_EQ(entry, new_entry);
4082 4080
4083 // We can handle title updates when we don't have an entry in 4081 // We can handle title updates when we don't have an entry in
4084 // UpdateTitleForEntry, but only if the update is from the current RVH. 4082 // UpdateTitleForEntry, but only if the update is from the current RVH.
4085 // TODO(avi): Change to make decisions based on the RenderFrameHost. 4083 // TODO(avi): Change to make decisions based on the RenderFrameHost.
4086 if (!entry && render_frame_host != GetMainFrame()) 4084 if (!entry && render_frame_host != GetMainFrame())
4087 return; 4085 return;
4088 4086
4089 // TODO(evan): make use of title_direction. 4087 // TODO(evan): make use of title_direction.
4090 // http://code.google.com/p/chromium/issues/detail?id=27094 4088 // http://code.google.com/p/chromium/issues/detail?id=27094
(...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after
4655 return NULL; 4653 return NULL;
4656 } 4654 }
4657 4655
4658 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { 4656 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) {
4659 force_disable_overscroll_content_ = force_disable; 4657 force_disable_overscroll_content_ = force_disable;
4660 if (view_) 4658 if (view_)
4661 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); 4659 view_->SetOverscrollControllerEnabled(CanOverscrollContent());
4662 } 4660 }
4663 4661
4664 } // namespace content 4662 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_view_host_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698