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