OLD | NEW |
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 3941 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3952 // when the user is scrolling and entering form data, as well as when we're | 3952 // when the user is scrolling and entering form data, as well as when we're |
3953 // leaving a page, in which case our state may have already been moved to | 3953 // leaving a page, in which case our state may have already been moved to |
3954 // the next page. The navigation controller will look up the appropriate | 3954 // the next page. The navigation controller will look up the appropriate |
3955 // NavigationEntry and update it when it is notified via the delegate. | 3955 // NavigationEntry and update it when it is notified via the delegate. |
3956 RenderViewHostImpl* rvhi = static_cast<RenderViewHostImpl*>(rvh); | 3956 RenderViewHostImpl* rvhi = static_cast<RenderViewHostImpl*>(rvh); |
3957 NavigationEntryImpl* entry = controller_.GetEntryWithPageID( | 3957 NavigationEntryImpl* entry = controller_.GetEntryWithPageID( |
3958 rvhi->GetSiteInstance(), page_id); | 3958 rvhi->GetSiteInstance(), page_id); |
3959 if (!entry) | 3959 if (!entry) |
3960 return; | 3960 return; |
3961 | 3961 |
3962 NavigationEntryImpl* new_entry = controller_.GetEntryWithUniqueID( | 3962 // Sanity check that ensures nav_entry_id and page_id point to the same |
3963 static_cast<RenderFrameHostImpl*>(rvhi->GetMainFrame())->nav_entry_id()); | 3963 // navigation entry. |
| 3964 if (rvhi->GetMainFrame()) { |
| 3965 NavigationEntryImpl* new_entry = controller_.GetEntryWithUniqueID( |
| 3966 static_cast<RenderFrameHostImpl*>(rvhi->GetMainFrame()) |
| 3967 ->nav_entry_id()); |
3964 | 3968 |
3965 DCHECK_EQ(entry, new_entry); | 3969 DCHECK_EQ(entry, new_entry); |
| 3970 } |
3966 | 3971 |
3967 if (page_state == entry->GetPageState()) | 3972 if (page_state == entry->GetPageState()) |
3968 return; // Nothing to update. | 3973 return; // Nothing to update. |
3969 entry->SetPageState(page_state); | 3974 entry->SetPageState(page_state); |
3970 controller_.NotifyEntryChanged(entry); | 3975 controller_.NotifyEntryChanged(entry); |
3971 } | 3976 } |
3972 | 3977 |
3973 void WebContentsImpl::UpdateTargetURL(RenderViewHost* render_view_host, | 3978 void WebContentsImpl::UpdateTargetURL(RenderViewHost* render_view_host, |
3974 const GURL& url) { | 3979 const GURL& url) { |
3975 if (fullscreen_widget_routing_id_ != MSG_ROUTING_NONE) { | 3980 if (fullscreen_widget_routing_id_ != MSG_ROUTING_NONE) { |
(...skipping 732 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4708 const WebContentsObserver::MediaPlayerId& id) { | 4713 const WebContentsObserver::MediaPlayerId& id) { |
4709 FOR_EACH_OBSERVER(WebContentsObserver, observers_, MediaStartedPlaying(id)); | 4714 FOR_EACH_OBSERVER(WebContentsObserver, observers_, MediaStartedPlaying(id)); |
4710 } | 4715 } |
4711 | 4716 |
4712 void WebContentsImpl::MediaStoppedPlaying( | 4717 void WebContentsImpl::MediaStoppedPlaying( |
4713 const WebContentsObserver::MediaPlayerId& id) { | 4718 const WebContentsObserver::MediaPlayerId& id) { |
4714 FOR_EACH_OBSERVER(WebContentsObserver, observers_, MediaStoppedPlaying(id)); | 4719 FOR_EACH_OBSERVER(WebContentsObserver, observers_, MediaStoppedPlaying(id)); |
4715 } | 4720 } |
4716 | 4721 |
4717 } // namespace content | 4722 } // namespace content |
OLD | NEW |