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

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

Issue 1143333003: Eliminate redundancy in the parameters to NotifyEntryChanged. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 (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 3616 matching lines...) Expand 10 before | Expand all | Expand 10 after
3627 // TODO(creis): We can't update state for cross-process subframes until we 3627 // TODO(creis): We can't update state for cross-process subframes until we
3628 // have FrameNavigationEntries. Once we do, this should be a DCHECK. 3628 // have FrameNavigationEntries. Once we do, this should be a DCHECK.
3629 if (rvh->GetDelegate()->GetAsWebContents() != this) 3629 if (rvh->GetDelegate()->GetAsWebContents() != this)
3630 return; 3630 return;
3631 3631
3632 // We must be prepared to handle state updates for any page, these occur 3632 // We must be prepared to handle state updates for any page, these occur
3633 // when the user is scrolling and entering form data, as well as when we're 3633 // when the user is scrolling and entering form data, as well as when we're
3634 // leaving a page, in which case our state may have already been moved to 3634 // leaving a page, in which case our state may have already been moved to
3635 // the next page. The navigation controller will look up the appropriate 3635 // the next page. The navigation controller will look up the appropriate
3636 // NavigationEntry and update it when it is notified via the delegate. 3636 // NavigationEntry and update it when it is notified via the delegate.
3637 NavigationEntryImpl* entry = controller_.GetEntryWithPageID(
3638 rvh->GetSiteInstance(), page_id);
3637 3639
3638 int entry_index = controller_.GetEntryIndexWithPageID( 3640 if (!entry)
3639 rvh->GetSiteInstance(), page_id);
3640 if (entry_index < 0)
3641 return; 3641 return;
3642 NavigationEntry* entry = controller_.GetEntryAtIndex(entry_index);
3643 3642
3644 if (page_state == entry->GetPageState()) 3643 if (page_state == entry->GetPageState())
3645 return; // Nothing to update. 3644 return; // Nothing to update.
3646 entry->SetPageState(page_state); 3645 entry->SetPageState(page_state);
3647 controller_.NotifyEntryChanged(entry, entry_index); 3646 controller_.NotifyEntryChanged(entry);
3648 } 3647 }
3649 3648
3650 void WebContentsImpl::UpdateTargetURL(RenderViewHost* render_view_host, 3649 void WebContentsImpl::UpdateTargetURL(RenderViewHost* render_view_host,
3651 const GURL& url) { 3650 const GURL& url) {
3652 if (fullscreen_widget_routing_id_ != MSG_ROUTING_NONE) { 3651 if (fullscreen_widget_routing_id_ != MSG_ROUTING_NONE) {
3653 // If we're fullscreen only update the url if it's from the fullscreen 3652 // If we're fullscreen only update the url if it's from the fullscreen
3654 // renderer. 3653 // renderer.
3655 RenderWidgetHostView* fs = GetFullscreenRenderWidgetHostView(); 3654 RenderWidgetHostView* fs = GetFullscreenRenderWidgetHostView();
3656 if (fs && fs->GetRenderWidgetHost() != render_view_host) 3655 if (fs && fs->GetRenderWidgetHost() != render_view_host)
3657 return; 3656 return;
(...skipping 731 matching lines...) Expand 10 before | Expand all | Expand 10 after
4389 player_map->erase(it); 4388 player_map->erase(it);
4390 } 4389 }
4391 4390
4392 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { 4391 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) {
4393 force_disable_overscroll_content_ = force_disable; 4392 force_disable_overscroll_content_ = force_disable;
4394 if (view_) 4393 if (view_)
4395 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); 4394 view_->SetOverscrollControllerEnabled(CanOverscrollContent());
4396 } 4395 }
4397 4396
4398 } // namespace content 4397 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/frame_host/navigation_entry_impl.cc ('k') | content/public/browser/navigation_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698