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

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

Issue 1259213003: Ensure that title and state updating works without page id. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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 (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 3821 matching lines...) Expand 10 before | Expand all | Expand 10 after
3832 3832
3833 NavigationEntryImpl* new_entry = controller_.GetEntryWithUniqueID( 3833 NavigationEntryImpl* new_entry = controller_.GetEntryWithUniqueID(
3834 rvhi->nav_entry_id()); 3834 rvhi->nav_entry_id());
3835 3835
3836 if (SiteIsolationPolicy::UseSubframeNavigationEntries()) { 3836 if (SiteIsolationPolicy::UseSubframeNavigationEntries()) {
3837 // TODO(creis): We can't properly update state for cross-process subframes 3837 // TODO(creis): We can't properly update state for cross-process subframes
3838 // until PageState is decomposed into FrameStates. Until then, use the new 3838 // until PageState is decomposed into FrameStates. Until then, use the new
3839 // method. 3839 // method.
3840 entry = new_entry; 3840 entry = new_entry;
3841 } else { 3841 } else {
3842 DCHECK_EQ(entry, new_entry); 3842 CHECK_EQ(entry, new_entry);
3843 } 3843 }
3844 3844
3845 if (page_state == entry->GetPageState()) 3845 if (page_state == entry->GetPageState())
3846 return; // Nothing to update. 3846 return; // Nothing to update.
3847 entry->SetPageState(page_state); 3847 entry->SetPageState(page_state);
3848 controller_.NotifyEntryChanged(entry); 3848 controller_.NotifyEntryChanged(entry);
3849 } 3849 }
3850 3850
3851 void WebContentsImpl::UpdateTargetURL(RenderViewHost* render_view_host, 3851 void WebContentsImpl::UpdateTargetURL(RenderViewHost* render_view_host,
3852 const GURL& url) { 3852 const GURL& url) {
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
4012 4012
4013 // Try to find the navigation entry, which might not be the current one. 4013 // Try to find the navigation entry, which might not be the current one.
4014 // For example, it might be from a recently swapped out RFH. 4014 // For example, it might be from a recently swapped out RFH.
4015 NavigationEntryImpl* entry = controller_.GetEntryWithPageID( 4015 NavigationEntryImpl* entry = controller_.GetEntryWithPageID(
4016 render_frame_host->GetSiteInstance(), page_id); 4016 render_frame_host->GetSiteInstance(), page_id);
4017 4017
4018 RenderViewHostImpl* rvhi = 4018 RenderViewHostImpl* rvhi =
4019 static_cast<RenderViewHostImpl*>(render_frame_host->GetRenderViewHost()); 4019 static_cast<RenderViewHostImpl*>(render_frame_host->GetRenderViewHost());
4020 NavigationEntryImpl* new_entry = controller_.GetEntryWithUniqueID( 4020 NavigationEntryImpl* new_entry = controller_.GetEntryWithUniqueID(
4021 rvhi->nav_entry_id()); 4021 rvhi->nav_entry_id());
4022 DCHECK_EQ(entry, new_entry); 4022 CHECK_EQ(entry, new_entry);
4023 4023
4024 // We can handle title updates when we don't have an entry in 4024 // We can handle title updates when we don't have an entry in
4025 // UpdateTitleForEntry, but only if the update is from the current RVH. 4025 // UpdateTitleForEntry, but only if the update is from the current RVH.
4026 // TODO(avi): Change to make decisions based on the RenderFrameHost. 4026 // TODO(avi): Change to make decisions based on the RenderFrameHost.
4027 if (!entry && render_frame_host != GetMainFrame()) 4027 if (!entry && render_frame_host != GetMainFrame())
4028 return; 4028 return;
4029 4029
4030 // TODO(evan): make use of title_direction. 4030 // TODO(evan): make use of title_direction.
4031 // http://code.google.com/p/chromium/issues/detail?id=27094 4031 // http://code.google.com/p/chromium/issues/detail?id=27094
4032 if (!UpdateTitleForEntry(entry, title)) 4032 if (!UpdateTitleForEntry(entry, title))
(...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after
4558 player_map->erase(it); 4558 player_map->erase(it);
4559 } 4559 }
4560 4560
4561 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { 4561 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) {
4562 force_disable_overscroll_content_ = force_disable; 4562 force_disable_overscroll_content_ = force_disable;
4563 if (view_) 4563 if (view_)
4564 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); 4564 view_->SetOverscrollControllerEnabled(CanOverscrollContent());
4565 } 4565 }
4566 4566
4567 } // namespace content 4567 } // 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