diff options
author | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-13 06:02:39 +0000 |
---|---|---|
committer | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-13 06:02:39 +0000 |
commit | efdb3e59f68fe34ef19dd6e52a5555e19f9b26b4 (patch) | |
tree | 717f7caca9e5b8191c0f1ff4cb1f3b00c0281e75 /chrome/renderer | |
parent | 235df3ac876638d8f09eb62c6b8504446e19b63b (diff) | |
download | chromium_src-efdb3e59f68fe34ef19dd6e52a5555e19f9b26b4.zip chromium_src-efdb3e59f68fe34ef19dd6e52a5555e19f9b26b4.tar.gz chromium_src-efdb3e59f68fe34ef19dd6e52a5555e19f9b26b4.tar.bz2 |
Re-do r15244 again.
Originally reviewed at http://codereview.chromium.org/100353
Eliminate webkit/glue/webhistoryitem* in favor of adding a
NavigateBackForwardSoon method WebViewDelegate. This moves
all of the hacky details of how we intercept "history.{back,
forward,go}" into the webkit layer. My eventual plan is to
teach WebCore how to make this not hacky.
In this version of the CL, TestWebViewDelegate performs the
back/forward navigation directly in NavigateBackForwardSoon
instead of using PostTask to delay it. I'm doing this to
minimize regressions so that I can hopefully get the rest of
this CL landed.
I also already made the changes to WebKit to force history.
{back,forward,go} to be processed asynchronously.
BUG=11423
TBR=mpcomplete
Review URL: http://codereview.chromium.org/115288
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15940 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer')
-rw-r--r-- | chrome/renderer/render_view.cc | 23 | ||||
-rw-r--r-- | chrome/renderer/render_view.h | 11 |
2 files changed, 2 insertions, 32 deletions
diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc index 979f74f..b8dff80 100644 --- a/chrome/renderer/render_view.cc +++ b/chrome/renderer/render_view.cc @@ -68,7 +68,6 @@ #include "webkit/glue/webdropdata.h" #include "webkit/glue/weberror.h" #include "webkit/glue/webframe.h" -#include "webkit/glue/webhistoryitem.h" #include "webkit/glue/webkit_glue.h" #include "webkit/glue/webpreferences.h" #include "webkit/glue/webplugin_delegate.h" @@ -1561,13 +1560,6 @@ WindowOpenDisposition RenderView::DispositionForNavigationAction( url.SchemeIs(chrome::kViewSourceScheme)) { OpenURL(webview, url, GURL(), disposition); return IGNORE_ACTION; // Suppress the load here. - } else if (url.SchemeIs(kBackForwardNavigationScheme)) { - std::string offset_str = url.ExtractFileName(); - int offset; - if (StringToInt(offset_str, &offset)) { - GoToEntryAtOffset(offset); - return IGNORE_ACTION; // The browser process handles this one. - } } } } @@ -2445,20 +2437,7 @@ void RenderView::OnAutofillFormSubmitted(WebView* webview, Send(new ViewHostMsg_AutofillFormSubmitted(routing_id_, form)); } -WebHistoryItem* RenderView::GetHistoryEntryAtOffset(int offset) { - // Our history list is kept in the browser process on the UI thread. Since - // we can't make a sync IPC call to that thread without risking deadlock, - // we use a trick: construct a fake history item of the form: - // history://go/OFFSET - // When WebCore tells us to navigate to it, we tell the browser process to - // do a back/forward navigation instead. - - GURL url(StringPrintf("%s://go/%d", kBackForwardNavigationScheme, offset)); - history_navigation_item_ = WebHistoryItem::Create(url, L"", "", NULL); - return history_navigation_item_.get(); -} - -void RenderView::GoToEntryAtOffset(int offset) { +void RenderView::NavigateBackForwardSoon(int offset) { history_back_list_count_ += offset; history_forward_list_count_ -= offset; diff --git a/chrome/renderer/render_view.h b/chrome/renderer/render_view.h index a993327..436772c 100644 --- a/chrome/renderer/render_view.h +++ b/chrome/renderer/render_view.h @@ -279,7 +279,7 @@ class RenderView : public RenderWidget, virtual void TakeFocus(WebView* webview, bool reverse); virtual void JSOutOfMemory(); - virtual WebHistoryItem* GetHistoryEntryAtOffset(int offset); + virtual void NavigateBackForwardSoon(int offset); virtual int GetHistoryBackListCount(); virtual int GetHistoryForwardListCount(); virtual void OnNavStateChanged(WebView* webview); @@ -463,10 +463,6 @@ class RenderView : public RenderWidget, // keyword search. void AddGURLSearchProvider(const GURL& osd_url, bool autodetected); - // Tells the browser process to navigate to a back/forward entry at the given - // offset from current. - void GoToEntryAtOffset(int offset); - // RenderView IPC message handlers void SendThumbnail(); void OnPrintPages(); @@ -770,11 +766,6 @@ class RenderView : public RenderWidget, // out of date responses. int form_field_autofill_request_id_; - // A cached WebHistoryItem used for back/forward navigations initiated by - // WebCore (via the window.history.go API). We only have one such navigation - // pending at a time. - scoped_refptr<WebHistoryItem> history_navigation_item_; - // We need to prevent windows from closing themselves with a window.close() // call while a blocked popup notification is being displayed. We cannot // synchronously query the Browser process. We cannot wait for the Browser |