From 4c4d056f81e01dc743b6f1cc5773a0686759be23 Mon Sep 17 00:00:00 2001 From: "mal@chromium.org" Date: Thu, 1 Oct 2009 08:43:32 +0000 Subject: Revert 27705 - Move various methods from glue/webview.h to api/public/WebView.h ** browser_tests started failing at this revision. See: http://build.chromium.org/buildbot/waterfall/builders/Chromium%20XP/builds/7697/steps/browser_tests/logs/stdio ** I'll reorder the methods in webview_impl.cc in a followup CL. I wanted to keep this one easy to review. SetBackForwardListSize is no longer necessary given that BackForwardListChromium.cpp doesn't care about its capacity. R=dglazkov BUG=10033 TEST=none Review URL: http://codereview.chromium.org/251051 TBR=darin@chromium.org Review URL: http://codereview.chromium.org/246060 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27711 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/renderer/print_web_view_helper.cc | 2 +- chrome/renderer/render_view.cc | 23 ++++++++++++++--------- chrome/renderer/webplugin_delegate_proxy.cc | 2 +- 3 files changed, 16 insertions(+), 11 deletions(-) (limited to 'chrome') diff --git a/chrome/renderer/print_web_view_helper.cc b/chrome/renderer/print_web_view_helper.cc index 86c5fc1..c516c0e 100644 --- a/chrome/renderer/print_web_view_helper.cc +++ b/chrome/renderer/print_web_view_helper.cc @@ -98,7 +98,7 @@ bool PrintWebViewHelper::CopyAndPrint(const ViewMsg_PrintPages_Params& params, print_web_view_.reset(WebView::Create(this)); prefs.Apply(print_web_view_.get()); - print_web_view_->initializeMainFrame(NULL); + print_web_view_->InitializeMainFrame(NULL); print_pages_params_.reset(new ViewMsg_PrintPages_Params(params)); print_pages_params_->pages.clear(); // Print all pages of selection. diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc index 159a976..2861d9c 100644 --- a/chrome/renderer/render_view.cc +++ b/chrome/renderer/render_view.cc @@ -314,10 +314,15 @@ void RenderView::Init(gfx::NativeViewId parent_hwnd, webwidget_ = WebView::Create(this); webkit_preferences_.Apply(webview()); - webview()->initializeMainFrame(this); + webview()->InitializeMainFrame(this); OnSetRendererPrefs(renderer_prefs); + // Don't let WebCore keep a B/F list - we have our own. + // We let it keep 1 entry because FrameLoader::goToItem expects an item in the + // backForwardList, which is used only in ASSERTs. + webview()->SetBackForwardListSize(1); + routing_id_ = routing_id; render_thread_->AddRoute(routing_id_, this); // Take a reference on behalf of the RenderThread. This will be balanced @@ -738,7 +743,7 @@ void RenderView::OnNavigate(const ViewMsg_Navigate_Params& params) { // Stop loading the current page void RenderView::OnStop() { if (webview()) - webview()->mainFrame()->stopLoading(); + webview()->StopLoading(); } void RenderView::OnLoadAlternateHTMLText(const std::string& html, @@ -787,7 +792,7 @@ void RenderView::OnStopFinding(bool clear_selection) { WebFrame* frame = view->mainFrame(); while (frame) { frame->stopFinding(clear_selection); - frame = frame->traverseNext(false); + frame = view->GetNextFrameAfter(frame, false); } } @@ -2582,7 +2587,7 @@ void RenderView::OnFind(int request_id, const string16& search_text, const WebKit::WebFindOptions& options) { WebFrame* main_frame = webview()->mainFrame(); - WebFrame* frame_after_main = main_frame->traverseNext(true); + WebFrame* frame_after_main = webview()->GetNextFrameAfter(main_frame, true); WebFrame* focused_frame = webview()->focusedFrame(); WebFrame* search_frame = focused_frame; // start searching focused frame. @@ -2608,8 +2613,8 @@ void RenderView::OnFind(int request_id, // What is the next frame to search? (we might be going backwards). Note // that we specify wrap=true so that search_frame never becomes NULL. search_frame = options.forward ? - search_frame->traverseNext(true) : - search_frame->traversePrevious(true); + webview()->GetNextFrameAfter(search_frame, true) : + webview()->GetPreviousFrameBefore(search_frame, true); } while (!search_frame->hasVisibleContent() && search_frame != focused_frame); @@ -2675,7 +2680,7 @@ void RenderView::OnFind(int request_id, // Iterate to the next frame. The frame will not necessarily scope, for // example if it is not visible. - search_frame = search_frame->traverseNext(true); + search_frame = webview()->GetNextFrameAfter(search_frame, true); } while (search_frame != main_frame); } } @@ -3272,14 +3277,14 @@ void RenderView::OnClearFocusedNode() { void RenderView::OnSetBackground(const SkBitmap& background) { if (webview()) - webview()->setIsTransparent(!background.empty()); + webview()->SetIsTransparent(!background.empty()); SetBackground(background); } void RenderView::OnSetActive(bool active) { if (webview()) - webview()->setIsActive(active); + webview()->SetActive(active); } void RenderView::SendExtensionRequest(const std::string& name, diff --git a/chrome/renderer/webplugin_delegate_proxy.cc b/chrome/renderer/webplugin_delegate_proxy.cc index af4760b..52ee244 100644 --- a/chrome/renderer/webplugin_delegate_proxy.cc +++ b/chrome/renderer/webplugin_delegate_proxy.cc @@ -964,7 +964,7 @@ void WebPluginDelegateProxy::OnSetDropEffect(const NPVariant_Param& object, if (!drag_id || !WebBindings::isDragEvent(event)) return; - *success = webview->setDropEffect(effect != 0); + *success = webview->SetDropEffect(effect != 0); } void WebPluginDelegateProxy::OnMissingPluginStatus(int status) { -- cgit v1.1