diff options
author | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-16 07:58:05 +0000 |
---|---|---|
committer | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-16 07:58:05 +0000 |
commit | f46aff6ee482e56eb3e885c65cd8d5989ac133af (patch) | |
tree | 256e4da27837872305dde8cc7ef668189439e4b1 /chrome/renderer | |
parent | ddc5288912f95a6cc89e93db5ef2c779b4a88838 (diff) | |
download | chromium_src-f46aff6ee482e56eb3e885c65cd8d5989ac133af.zip chromium_src-f46aff6ee482e56eb3e885c65cd8d5989ac133af.tar.gz chromium_src-f46aff6ee482e56eb3e885c65cd8d5989ac133af.tar.bz2 |
This fixes http://code.google.com/p/chromium/issues/detail?id=146&,
which was an issue with navigation attempts initiated by Flash not
working correctly in Chrome.
The plugin would initiate a navigation in response to a user click. This
would eventually result in a call to a script on the page, which would
query the history in a timer, and would end up resetting the selected
URL to the original URL as the history length would not be updated as
yet. The reason being the following:-
1. A Frame navigation is initiated by the renderer in response to the
user click.
2. This is sent as an async message to the browser UI thread.
3. When the navigation in the browser completes we update the history
info in render view asynchronously.
The fix is to attempt to update the history count when we receive notifications
from webkit. These include notifications for items being added to the history,
navigations based on history (like history.back/forward/goto, etc).
These counts continue to be updated as before from the browser as well.
Added UI tests to test these cases.
Bug=146
R=jam
Review URL: http://codereview.chromium.org/7412
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3457 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer')
-rw-r--r-- | chrome/renderer/render_view.cc | 8 | ||||
-rw-r--r-- | chrome/renderer/render_view.h | 2 |
2 files changed, 10 insertions, 0 deletions
diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc index 0da4929..ef69bb6 100644 --- a/chrome/renderer/render_view.cc +++ b/chrome/renderer/render_view.cc @@ -2208,6 +2208,9 @@ WebHistoryItem* RenderView::GetHistoryEntryAtOffset(int offset) { } void RenderView::GoToEntryAtOffsetAsync(int offset) { + history_back_list_count_ += offset; + history_forward_list_count_ -= offset; + Send(new ViewHostMsg_GoToEntryAtOffset(routing_id_, offset)); } @@ -2548,6 +2551,11 @@ void RenderView::TransitionToCommittedForNewPage() { #endif } +void RenderView::DidAddHistoryItem() { + history_back_list_count_++; + history_forward_list_count_ = 0; +} + void RenderView::OnMessageFromExternalHost( const std::string& target, const std::string& message) { if (message.empty()) diff --git a/chrome/renderer/render_view.h b/chrome/renderer/render_view.h index 51b9d93..a59f328 100644 --- a/chrome/renderer/render_view.h +++ b/chrome/renderer/render_view.h @@ -485,6 +485,8 @@ class RenderView : public RenderWidget, public WebViewDelegate, virtual void TransitionToCommittedForNewPage(); + virtual void DidAddHistoryItem(); + // A helper method used by WasOpenedByUserGesture. bool WasOpenedByUserGestureHelper() const; |