diff options
author | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-30 16:55:27 +0000 |
---|---|---|
committer | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-30 16:55:27 +0000 |
commit | 26aa04898e37692f354a9f97df01ff1fc7bbb14e (patch) | |
tree | d83f599bdc5083646ea70aec4c6906707e671b71 /webkit/tools | |
parent | fbc805556ed3f7e15718313907481821ef6908b4 (diff) | |
download | chromium_src-26aa04898e37692f354a9f97df01ff1fc7bbb14e.zip chromium_src-26aa04898e37692f354a9f97df01ff1fc7bbb14e.tar.gz chromium_src-26aa04898e37692f354a9f97df01ff1fc7bbb14e.tar.bz2 |
Hook up webkit/api/public/WebView.h
This change does not completely eliminate webkit/glue/webview.h. Instead,
the old WebView extends from the new WebView temporarily as we complete
the transition.
R=dglazkov
BUG=10033
TEST=none
Review URL: http://codereview.chromium.org/257001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27620 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/tools')
-rw-r--r-- | webkit/tools/test_shell/drag_delegate.cc | 4 | ||||
-rw-r--r-- | webkit/tools/test_shell/drop_delegate.cc | 8 | ||||
-rw-r--r-- | webkit/tools/test_shell/event_sending_controller.cc | 38 | ||||
-rw-r--r-- | webkit/tools/test_shell/layout_test_controller.cc | 14 | ||||
-rw-r--r-- | webkit/tools/test_shell/plugin_tests.cc | 20 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_shell.cc | 16 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_shell_gtk.cc | 4 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_webview_delegate.cc | 18 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_webview_delegate_gtk.cc | 4 | ||||
-rw-r--r-- | webkit/tools/test_shell/text_input_controller.cc | 2 |
10 files changed, 64 insertions, 64 deletions
diff --git a/webkit/tools/test_shell/drag_delegate.cc b/webkit/tools/test_shell/drag_delegate.cc index d9c45cd..0fc97a3 100644 --- a/webkit/tools/test_shell/drag_delegate.cc +++ b/webkit/tools/test_shell/drag_delegate.cc @@ -35,7 +35,7 @@ void TestDragDelegate::OnDragSourceDrop() { gfx::Point client; gfx::Point screen; GetCursorPositions(source_hwnd_, &client, &screen); - webview_->DragSourceEndedAt(client, screen, WebKit::WebDragOperationCopy); + webview_->dragSourceEndedAt(client, screen, WebKit::WebDragOperationCopy); // TODO(snej): Pass the real drag operation instead } @@ -43,5 +43,5 @@ void TestDragDelegate::OnDragSourceMove() { gfx::Point client; gfx::Point screen; GetCursorPositions(source_hwnd_, &client, &screen); - webview_->DragSourceMovedTo(client, screen); + webview_->dragSourceMovedTo(client, screen); } diff --git a/webkit/tools/test_shell/drop_delegate.cc b/webkit/tools/test_shell/drop_delegate.cc index ce0e0dc6..d7d3934 100644 --- a/webkit/tools/test_shell/drop_delegate.cc +++ b/webkit/tools/test_shell/drop_delegate.cc @@ -24,7 +24,7 @@ DWORD TestDropDelegate::OnDragEnter(IDataObject* data_object, POINT client_pt = cursor_position; ScreenToClient(GetHWND(), &client_pt); - WebDragOperation op = webview_->DragTargetDragEnter( + WebDragOperation op = webview_->dragTargetDragEnter( drop_data.ToDragData(), drop_data.identity, WebPoint(client_pt.x, client_pt.y), WebPoint(cursor_position.x, cursor_position.y), @@ -40,7 +40,7 @@ DWORD TestDropDelegate::OnDragOver(IDataObject* data_object, DWORD effect) { POINT client_pt = cursor_position; ScreenToClient(GetHWND(), &client_pt); - WebDragOperation op = webview_->DragTargetDragOver( + WebDragOperation op = webview_->dragTargetDragOver( WebPoint(client_pt.x, client_pt.y), WebPoint(cursor_position.x, cursor_position.y), WebDragOperationCopy); @@ -50,7 +50,7 @@ DWORD TestDropDelegate::OnDragOver(IDataObject* data_object, } void TestDropDelegate::OnDragLeave(IDataObject* data_object) { - webview_->DragTargetDragLeave(); + webview_->dragTargetDragLeave(); } DWORD TestDropDelegate::OnDrop(IDataObject* data_object, @@ -59,7 +59,7 @@ DWORD TestDropDelegate::OnDrop(IDataObject* data_object, DWORD effect) { POINT client_pt = cursor_position; ScreenToClient(GetHWND(), &client_pt); - webview_->DragTargetDrop( + webview_->dragTargetDrop( WebPoint(client_pt.x, client_pt.y), WebPoint(cursor_position.x, cursor_position.y)); diff --git a/webkit/tools/test_shell/event_sending_controller.cc b/webkit/tools/test_shell/event_sending_controller.cc index 6d24a52..4333ac0 100644 --- a/webkit/tools/test_shell/event_sending_controller.cc +++ b/webkit/tools/test_shell/event_sending_controller.cc @@ -233,7 +233,7 @@ void EventSendingController::DoDragDrop(const WebKit::WebPoint &event_pos, WebPoint screen_point(event.globalX, event.globalY); current_drag_data = drag_data; current_drag_effects_allowed = mask; - current_drag_effect = webview()->DragTargetDragEnter( + current_drag_effect = webview()->dragTargetDragEnter( drag_data, 0, client_point, screen_point, current_drag_effects_allowed); // Finish processing events. @@ -334,17 +334,16 @@ void EventSendingController::mouseUp( WebPoint client_point(e.x, e.y); WebPoint screen_point(e.globalX, e.globalY); - webview()->DragSourceMovedTo(client_point, screen_point); - current_drag_effect = webview()->DragTargetDragOver(client_point, - screen_point, - current_drag_effects_allowed); + webview()->dragSourceMovedTo(client_point, screen_point); + current_drag_effect = webview()->dragTargetDragOver( + client_point, screen_point, current_drag_effects_allowed); if (current_drag_effect) { - webview()->DragTargetDrop(client_point, screen_point); + webview()->dragTargetDrop(client_point, screen_point); } else { - webview()->DragTargetDragLeave(); + webview()->dragTargetDragLeave(); } - webview()->DragSourceEndedAt(client_point, screen_point, - current_drag_effect); + webview()->dragSourceEndedAt( + client_point, screen_point, current_drag_effect); current_drag_data.reset(); } @@ -380,10 +379,9 @@ void EventSendingController::DoMouseMove(const WebMouseEvent& e) { WebPoint client_point(e.x, e.y); WebPoint screen_point(e.globalX, e.globalY); - webview()->DragSourceMovedTo(client_point, screen_point); - current_drag_effect = webview()->DragTargetDragOver( - client_point, screen_point, - current_drag_effects_allowed); + webview()->dragSourceMovedTo(client_point, screen_point); + current_drag_effect = webview()->dragTargetDragOver( + client_point, screen_point, current_drag_effects_allowed); } } @@ -541,25 +539,25 @@ void EventSendingController::leapForward( // WebKit/WebView/WebView.mm) void EventSendingController::textZoomIn( const CppArgumentList& args, CppVariant* result) { - webview()->ZoomIn(true); + webview()->zoomIn(true); result->SetNull(); } void EventSendingController::textZoomOut( const CppArgumentList& args, CppVariant* result) { - webview()->ZoomOut(true); + webview()->zoomOut(true); result->SetNull(); } void EventSendingController::zoomPageIn( const CppArgumentList& args, CppVariant* result) { - webview()->ZoomIn(false); + webview()->zoomIn(false); result->SetNull(); } void EventSendingController::zoomPageOut( const CppArgumentList& args, CppVariant* result) { - webview()->ZoomOut(false); + webview()->zoomOut(false); result->SetNull(); } @@ -638,9 +636,9 @@ void EventSendingController::beginDragWithFiles( // Provide a drag source. WebPoint client_point(last_mouse_pos_.x(), last_mouse_pos_.y()); WebPoint screen_point(last_mouse_pos_.x(), last_mouse_pos_.y()); - webview()->DragTargetDragEnter(current_drag_data, 0, - client_point, screen_point, - current_drag_effects_allowed); + webview()->dragTargetDragEnter( + current_drag_data, 0, client_point, screen_point, + current_drag_effects_allowed); // dragMode saves events and then replays them later. We don't need/want that. dragMode.Set(false); diff --git a/webkit/tools/test_shell/layout_test_controller.cc b/webkit/tools/test_shell/layout_test_controller.cc index 2d0746e..bc88eb5 100644 --- a/webkit/tools/test_shell/layout_test_controller.cc +++ b/webkit/tools/test_shell/layout_test_controller.cc @@ -339,7 +339,7 @@ class WorkItemLoadingScript : public LayoutTestController::WorkItem { public: WorkItemLoadingScript(const string& script) : script_(script) {} bool Run(TestShell* shell) { - shell->webView()->GetMainFrame()->executeScript( + shell->webView()->mainFrame()->executeScript( WebScriptSource(WebString::fromUTF8(script_))); return true; // TODO(darin): Did it really start a navigation? } @@ -351,7 +351,7 @@ class WorkItemNonLoadingScript : public LayoutTestController::WorkItem { public: WorkItemNonLoadingScript(const string& script) : script_(script) {} bool Run(TestShell* shell) { - shell->webView()->GetMainFrame()->executeScript( + shell->webView()->mainFrame()->executeScript( WebScriptSource(WebString::fromUTF8(script_))); return false; } @@ -389,7 +389,7 @@ class WorkItemLoad : public LayoutTestController::WorkItem { void LayoutTestController::queueLoad( const CppArgumentList& args, CppVariant* result) { if (args.size() > 0 && args[0].isString()) { - GURL current_url = shell_->webView()->GetMainFrame()->url(); + GURL current_url = shell_->webView()->mainFrame()->url(); GURL full_url = current_url.Resolve(args[0].ToString()); string target = ""; @@ -413,7 +413,7 @@ void LayoutTestController::objCIdentityIsEqual( void LayoutTestController::Reset() { if (shell_) { - shell_->webView()->ResetZoom(); + shell_->webView()->zoomDefault(); shell_->webView()->SetTabKeyCyclesThroughElements(true); } dump_as_text_ = false; @@ -552,7 +552,7 @@ void LayoutTestController::execCommand( value = args[2].ToString(); // Note: webkit's version does not return the boolean, so neither do we. - shell_->webView()->GetFocusedFrame()->executeCommand( + shell_->webView()->focusedFrame()->executeCommand( WebString::fromUTF8(command), WebString::fromUTF8(value)); } result->SetNull(); @@ -566,7 +566,7 @@ void LayoutTestController::isCommandEnabled( } std::string command = args[0].ToString(); - bool rv = shell_->webView()->GetFocusedFrame()->isCommandEnabled( + bool rv = shell_->webView()->focusedFrame()->isCommandEnabled( WebString::fromUTF8(command)); result->Set(rv); } @@ -824,7 +824,7 @@ void LayoutTestController::evaluateScriptInIsolatedWorld( const CppArgumentList& args, CppVariant* result) { if (args.size() > 0 && args[0].isString()) { WebScriptSource source(WebString::fromUTF8(args[0].ToString())); - shell_->webView()->GetMainFrame()->executeScriptInNewWorld(&source, 1, 1); + shell_->webView()->mainFrame()->executeScriptInNewWorld(&source, 1, 1); } result->SetNull(); } diff --git a/webkit/tools/test_shell/plugin_tests.cc b/webkit/tools/test_shell/plugin_tests.cc index 3c07a07..7f7214e 100644 --- a/webkit/tools/test_shell/plugin_tests.cc +++ b/webkit/tools/test_shell/plugin_tests.cc @@ -100,22 +100,22 @@ TEST_F(PluginTest, Refresh) { // test plugin from a previous test. DeleteTestPlugin(); ASSERT_FALSE(file_util::PathExists(plugin_file_path_)); - test_shell_->webView()->GetMainFrame()->executeScript(refresh); + test_shell_->webView()->mainFrame()->executeScript(refresh); - test_shell_->webView()->GetMainFrame()->loadHTMLString( + test_shell_->webView()->mainFrame()->loadHTMLString( html, GURL("about:blank")); test_shell_->WaitTestFinished(); std::string text; - test_shell_->webView()->GetMainFrame()->executeScript(call_check); - text = test_shell_->webView()->GetMainFrame()->contentAsText(10000).utf8(); + test_shell_->webView()->mainFrame()->executeScript(call_check); + text = test_shell_->webView()->mainFrame()->contentAsText(10000).utf8(); ASSERT_EQ(text, "FAIL"); CopyTestPlugin(); - test_shell_->webView()->GetMainFrame()->executeScript(refresh); - test_shell_->webView()->GetMainFrame()->executeScript(call_check); - text = test_shell_->webView()->GetMainFrame()->contentAsText(10000).utf8(); + test_shell_->webView()->mainFrame()->executeScript(refresh); + test_shell_->webView()->mainFrame()->executeScript(call_check); + text = test_shell_->webView()->mainFrame()->contentAsText(10000).utf8(); ASSERT_EQ(text, "DONE"); } @@ -139,12 +139,12 @@ TEST_F(PluginTest, DefaultPluginLoadTest) { </DIV>\ "; - test_shell_->webView()->GetMainFrame()->loadHTMLString( + test_shell_->webView()->mainFrame()->loadHTMLString( html, GURL("about:blank")); test_shell_->WaitTestFinished(); std::string text = - test_shell_->webView()->GetMainFrame()->contentAsText(10000).utf8(); + test_shell_->webView()->mainFrame()->contentAsText(10000).utf8(); ASSERT_EQ(true, StartsWithASCII(text, "DONE", true)); } #endif @@ -188,7 +188,7 @@ TEST_F(PluginTest, PluginVisibilty) { test_shell_->LoadFile(test_html); test_shell_->WaitTestFinished(); - WebFrame* main_frame = test_shell_->webView()->GetMainFrame(); + WebFrame* main_frame = test_shell_->webView()->mainFrame(); HWND frame_hwnd = test_shell_->webViewWnd(); HWND plugin_hwnd = NULL; EnumChildWindows(frame_hwnd, EnumChildProc, diff --git a/webkit/tools/test_shell/test_shell.cc b/webkit/tools/test_shell/test_shell.cc index 46de77b..cce4997 100644 --- a/webkit/tools/test_shell/test_shell.cc +++ b/webkit/tools/test_shell/test_shell.cc @@ -196,7 +196,7 @@ void TestShell::Dump(TestShell* shell) { printf("#URL:%s\n", params->test_url.c_str()); // Dump the requested representation. - WebFrame* frame = shell->webView()->GetMainFrame(); + WebFrame* frame = shell->webView()->mainFrame(); if (frame) { bool should_dump_as_text = shell->layout_test_controller_->ShouldDumpAsText(); @@ -486,7 +486,7 @@ void TestShell::DumpBackForwardList(std::wstring* result) { } void TestShell::CallJSGC() { - webView()->GetMainFrame()->collectGarbage(); + webView()->mainFrame()->collectGarbage(); } WebView* TestShell::CreateWebView() { @@ -530,9 +530,9 @@ void TestShell::LoadURL(const GURL& url) { bool TestShell::Navigate(const TestNavigationEntry& entry, bool reload) { // Get the right target frame for the entry. - WebFrame* frame = webView()->GetMainFrame(); + WebFrame* frame = webView()->mainFrame(); if (!entry.GetTargetFrame().empty()) { - frame = webView()->GetFrameWithName( + frame = webView()->findFrameByName( WideToUTF16Hack(entry.GetTargetFrame())); } // TODO(mpcomplete): should we clear the target frame, or should @@ -567,7 +567,7 @@ bool TestShell::Navigate(const TestNavigationEntry& entry, bool reload) { // iframe would keep focus when the SetFocus called immediately after // LoadRequest, thus making some tests fail (see http://b/issue?id=845337 // for more details). - webView()->SetFocusedFrame(frame); + webView()->setFocusedFrame(frame); SetFocus(webViewHost(), true); return true; @@ -583,7 +583,7 @@ void TestShell::DumpDocumentText() { return; const std::string data = - WideToUTF8(webkit_glue::DumpDocumentText(webView()->GetMainFrame())); + WideToUTF8(webkit_glue::DumpDocumentText(webView()->mainFrame())); file_util::WriteFile(file_path, data.c_str(), data.length()); } @@ -593,12 +593,12 @@ void TestShell::DumpRenderTree() { return; const std::string data = - WideToUTF8(webkit_glue::DumpRenderer(webView()->GetMainFrame())); + WideToUTF8(webkit_glue::DumpRenderer(webView()->mainFrame())); file_util::WriteFile(file_path, data.c_str(), data.length()); } std::wstring TestShell::GetDocumentText() { - return webkit_glue::DumpDocumentText(webView()->GetMainFrame()); + return webkit_glue::DumpDocumentText(webView()->mainFrame()); } void TestShell::Reload() { diff --git a/webkit/tools/test_shell/test_shell_gtk.cc b/webkit/tools/test_shell/test_shell_gtk.cc index e4c0b19..c9319ab 100644 --- a/webkit/tools/test_shell/test_shell_gtk.cc +++ b/webkit/tools/test_shell/test_shell_gtk.cc @@ -23,6 +23,7 @@ #include "grit/webkit_resources.h" #include "net/base/mime_util.h" #include "net/base/net_util.h" +#include "webkit/api/public/WebPoint.h" #include "webkit/glue/plugins/plugin_list.h" #include "webkit/glue/resource_loader_bridge.h" #include "webkit/glue/webkit_glue.h" @@ -31,6 +32,7 @@ #include "webkit/tools/test_shell/test_navigation_controller.h" #include "webkit/tools/test_shell/test_webview_delegate.h" +using WebKit::WebPoint; using WebKit::WebWidget; namespace { @@ -114,7 +116,7 @@ gboolean DumpRenderTreeActivated(GtkWidget* widget, TestShell* shell) { // Callback for Debug > Show web inspector... menu item. gboolean ShowWebInspectorActivated(GtkWidget* widget, TestShell* shell) { - shell->webView()->InspectElement(0, 0); + shell->webView()->inspectElementAt(WebPoint()); return FALSE; // Don't stop this message. } diff --git a/webkit/tools/test_shell/test_webview_delegate.cc b/webkit/tools/test_shell/test_webview_delegate.cc index ab3aa12f..c7b1e27 100644 --- a/webkit/tools/test_shell/test_webview_delegate.cc +++ b/webkit/tools/test_shell/test_webview_delegate.cc @@ -517,7 +517,7 @@ void TestWebViewDelegate::startDragging( // ok_effect, &effect); //DCHECK(DRAGDROP_S_DROP == res || DRAGDROP_S_CANCEL == res); } - shell_->webView()->DragSourceSystemDragEnded(); + shell_->webView()->dragSourceSystemDragEnded(); } void TestWebViewDelegate::navigateBackForwardSoon(int offset) { @@ -965,16 +965,16 @@ void TestWebViewDelegate::WaitForPolicyDelegate() { // Private methods ----------------------------------------------------------- void TestWebViewDelegate::UpdateAddressBar(WebView* webView) { - WebFrame* mainFrame = webView->GetMainFrame(); + WebFrame* main_frame = webView->mainFrame(); - WebDataSource* dataSource = mainFrame->dataSource(); - if (!dataSource) - dataSource = mainFrame->provisionalDataSource(); - if (!dataSource) + WebDataSource* data_source = main_frame->dataSource(); + if (!data_source) + data_source = main_frame->provisionalDataSource(); + if (!data_source) return; // TODO(abarth): This is wrong! - SetAddressBarURL(dataSource->request().firstPartyForCookies()); + SetAddressBarURL(data_source->request().firstPartyForCookies()); } void TestWebViewDelegate::LocationChangeDone(WebFrame* frame) { @@ -1058,7 +1058,7 @@ void TestWebViewDelegate::UpdateSessionHistory(WebFrame* frame) { return; const WebHistoryItem& history_item = - shell_->webView()->GetMainFrame()->previousHistoryItem(); + shell_->webView()->mainFrame()->previousHistoryItem(); if (history_item.isNull()) return; @@ -1068,7 +1068,7 @@ void TestWebViewDelegate::UpdateSessionHistory(WebFrame* frame) { std::wstring TestWebViewDelegate::GetFrameDescription(WebFrame* webframe) { std::wstring name = UTF16ToWideHack(webframe->name()); - if (webframe == shell_->webView()->GetMainFrame()) { + if (webframe == shell_->webView()->mainFrame()) { if (name.length()) return L"main frame \"" + name + L"\""; else diff --git a/webkit/tools/test_shell/test_webview_delegate_gtk.cc b/webkit/tools/test_shell/test_webview_delegate_gtk.cc index c73d62a..8ba512b 100644 --- a/webkit/tools/test_shell/test_webview_delegate_gtk.cc +++ b/webkit/tools/test_shell/test_webview_delegate_gtk.cc @@ -59,9 +59,9 @@ void SelectionClipboardGetContents(GtkClipboard* clipboard, return; WebView* webview = static_cast<WebView*>(data); - WebFrame* frame = webview->GetFocusedFrame(); + WebFrame* frame = webview->focusedFrame(); if (!frame) - frame = webview->GetMainFrame(); + frame = webview->mainFrame(); DCHECK(frame); std::string selection; diff --git a/webkit/tools/test_shell/text_input_controller.cc b/webkit/tools/test_shell/text_input_controller.cc index 8ab7576..529fb61 100644 --- a/webkit/tools/test_shell/text_input_controller.cc +++ b/webkit/tools/test_shell/text_input_controller.cc @@ -41,7 +41,7 @@ TextInputController::TextInputController(TestShell* shell) { // static WebFrame* TextInputController::GetMainFrame() { - return shell_->webView()->GetMainFrame(); + return shell_->webView()->mainFrame(); } void TextInputController::insertText( |