diff options
author | finnur@google.com <finnur@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-07 00:29:17 +0000 |
---|---|---|
committer | finnur@google.com <finnur@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-07 00:29:17 +0000 |
commit | 799d9dea1be5fa710f5c0f7d9a4c00af830091b3 (patch) | |
tree | 7d7d09dbe72aed83cbf188aa51ac198a820165e7 /webkit | |
parent | d81e71ece74aa68db876e639c716e892637a116b (diff) | |
download | chromium_src-799d9dea1be5fa710f5c0f7d9a4c00af830091b3.zip chromium_src-799d9dea1be5fa710f5c0f7d9a4c00af830091b3.tar.gz chromium_src-799d9dea1be5fa710f5c0f7d9a4c00af830091b3.tar.bz2 |
Implementing that callback required to pass
LayoutTest/fast/dom/assign-to-window-status.html
which is testing whether we can assign values to
window.status.
BUG=1143492
Review URL: http://codereview.chromium.org/21147
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9366 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/glue/chrome_client_impl.cc | 14 | ||||
-rw-r--r-- | webkit/glue/chrome_client_impl.h | 13 | ||||
-rw-r--r-- | webkit/glue/webview_delegate.h | 15 | ||||
-rw-r--r-- | webkit/tools/layout_tests/test_lists/tests_fixable.txt | 7 | ||||
-rw-r--r-- | webkit/tools/test_shell/layout_test_controller.cc | 12 | ||||
-rw-r--r-- | webkit/tools/test_shell/layout_test_controller.h | 25 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_webview_delegate.cc | 63 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_webview_delegate.h | 50 |
8 files changed, 115 insertions, 84 deletions
diff --git a/webkit/glue/chrome_client_impl.cc b/webkit/glue/chrome_client_impl.cc index 6a04764..18269e1 100644 --- a/webkit/glue/chrome_client_impl.cc +++ b/webkit/glue/chrome_client_impl.cc @@ -60,7 +60,7 @@ class WebFileChooserCallbackImpl : public WebFileChooserCallback { private: RefPtr<WebCore::FileChooser> file_chooser_; - DISALLOW_EVIL_CONSTRUCTORS(WebFileChooserCallbackImpl); + DISALLOW_COPY_AND_ASSIGN(WebFileChooserCallbackImpl); }; ChromeClientImpl::ChromeClientImpl(WebViewImpl* webview) @@ -295,7 +295,7 @@ bool ChromeClientImpl::runBeforeUnloadConfirmPanel(const WebCore::String& messag void ChromeClientImpl::closeWindowSoon() { // Make sure this Page can no longer be found by JS. webview_->page()->setGroupName(WebCore::String()); - + // Make sure that all loading is stopped. Ensures that JS stops executing! webview_->StopLoading(); @@ -348,8 +348,12 @@ bool ChromeClientImpl::runJavaScriptPrompt(WebCore::Frame* frame, return false; } -void ChromeClientImpl::setStatusbarText(const WebCore::String&) { - // TODO(mbelshe): implement me +void ChromeClientImpl::setStatusbarText(const WebCore::String& message) { + WebViewDelegate* d = webview_->delegate(); + if (d) { + std::wstring wstr = webkit_glue::StringToStdWString(message); + d->SetStatusbarText(webview_, wstr); + } } bool ChromeClientImpl::shouldInterruptJavaScript() { @@ -370,7 +374,7 @@ WebCore::IntRect ChromeClientImpl::windowResizerRect() const { if (webview_->delegate()) { gfx::Rect resizer_rect; webview_->delegate()->GetRootWindowResizerRect(webview_, &resizer_rect); - rv = WebCore::IntRect(resizer_rect.x(), + rv = WebCore::IntRect(resizer_rect.x(), resizer_rect.y(), resizer_rect.width(), resizer_rect.height()); diff --git a/webkit/glue/chrome_client_impl.h b/webkit/glue/chrome_client_impl.h index 8ac4916..2c6fc22 100644 --- a/webkit/glue/chrome_client_impl.h +++ b/webkit/glue/chrome_client_impl.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_GLUE_CHROME_CLIENT_IMPL_H__ -#define WEBKIT_GLUE_CHROME_CLIENT_IMPL_H__ +#ifndef WEBKIT_GLUE_CHROME_CLIENT_IMPL_H_ +#define WEBKIT_GLUE_CHROME_CLIENT_IMPL_H_ #include "base/compiler_specific.h" @@ -21,7 +21,7 @@ struct WindowFeatures; // Handles window-level notifications from WebCore on behalf of a WebView. class ChromeClientImpl : public WebCore::ChromeClientChromium { -public: + public: ChromeClientImpl(WebViewImpl* webview); virtual ~ChromeClientImpl(); @@ -81,7 +81,7 @@ public: const WebCore::String& defaultValue, WebCore::String& result); - virtual void setStatusbarText(const WebCore::String&); + virtual void setStatusbarText(const WebCore::String& message); virtual bool shouldInterruptJavaScript(); // Returns true if anchors should accept keyboard focus with the tab key. @@ -127,7 +127,7 @@ public: virtual void formStateDidChange(const WebCore::Node*); -private: + private: WebViewImpl* webview_; // weak pointer bool toolbars_visible_; bool statusbar_visible_; @@ -138,5 +138,4 @@ private: bool ignore_next_set_cursor_; }; -#endif // WEBKIT_GLUE_CHROME_CLIENT_IMPL_H__ - +#endif // WEBKIT_GLUE_CHROME_CLIENT_IMPL_H_ diff --git a/webkit/glue/webview_delegate.h b/webkit/glue/webview_delegate.h index 955985e..2fe2351 100644 --- a/webkit/glue/webview_delegate.h +++ b/webkit/glue/webview_delegate.h @@ -23,8 +23,8 @@ // of ChromeClient and FrameLoaderClient not delegated in the WebKit // implementation; and some WebView additions. -#ifndef WEBKIT_GLUE_WEBVIEW_DELEGATE_H__ -#define WEBKIT_GLUE_WEBVIEW_DELEGATE_H__ +#ifndef WEBKIT_GLUE_WEBVIEW_DELEGATE_H_ +#define WEBKIT_GLUE_WEBVIEW_DELEGATE_H_ #include <string> #include <vector> @@ -93,7 +93,7 @@ class WebFileChooserCallback { virtual void OnFileChoose(const std::vector<std::wstring>& file_names) { } private: - DISALLOW_EVIL_CONSTRUCTORS(WebFileChooserCallback); + DISALLOW_COPY_AND_ASSIGN(WebFileChooserCallback); }; @@ -518,6 +518,10 @@ class WebViewDelegate : virtual public WebWidgetDelegate { return false; } + // Sets the status bar text. + virtual void SetStatusbarText(WebView* webview, + const std::wstring& message) { } + // Displays a "before unload" confirm panel associated with the given view. // The panel should have two buttons, e.g. "OK" and "Cancel", where OK means // that the navigation should continue, and Cancel means that the navigation @@ -772,8 +776,7 @@ class WebViewDelegate : virtual public WebWidgetDelegate { virtual ~WebViewDelegate() { } private: - DISALLOW_EVIL_CONSTRUCTORS(WebViewDelegate); + DISALLOW_COPY_AND_ASSIGN(WebViewDelegate); }; -#endif // WEBKIT_GLUE_WEBVIEW_DELEGATE_H__ - +#endif // WEBKIT_GLUE_WEBVIEW_DELEGATE_H_ diff --git a/webkit/tools/layout_tests/test_lists/tests_fixable.txt b/webkit/tools/layout_tests/test_lists/tests_fixable.txt index 2a60a1f..f115a25 100644 --- a/webkit/tools/layout_tests/test_lists/tests_fixable.txt +++ b/webkit/tools/layout_tests/test_lists/tests_fixable.txt @@ -135,7 +135,6 @@ DEFER : LayoutTests/fast/html/keygen.html = FAIL // Other // ----------------------------------------------------------------- - // Bug 5248 MAC : LayoutTests/http/tests/security/cross-frame-access-protocol-explicit-domain.html = FAIL MAC : LayoutTests/http/tests/security/cross-frame-access-protocol.html = FAIL @@ -145,12 +144,6 @@ MAC : LayoutTests/http/tests/security/cross-frame-access-protocol.html = FAIL // Linux pixeltest failure: Form control metrics incorrect LayoutTests/http/tests/navigation/javascriptlink-frames.html = FAIL -// Bug: 1143492 -// Window status should always return a string object -// WebKit does this to match IE, FF also fails this test. -// Obscure, not sure we care. DEFER for now. -DEFER : LayoutTests/fast/dom/assign-to-window-status.html = FAIL - // Bug: 742182, 845388 // Mac Safari under certain circumstances automatically places // a caret in editable document even when none was requested programatically. diff --git a/webkit/tools/test_shell/layout_test_controller.cc b/webkit/tools/test_shell/layout_test_controller.cc index 47700e2..e861d37 100644 --- a/webkit/tools/test_shell/layout_test_controller.cc +++ b/webkit/tools/test_shell/layout_test_controller.cc @@ -46,6 +46,7 @@ bool LayoutTestController::dump_resource_load_callbacks_ = false; bool LayoutTestController::dump_back_forward_list_ = false; bool LayoutTestController::dump_child_frame_scroll_positions_ = false; bool LayoutTestController::dump_child_frames_as_text_ = false; +bool LayoutTestController::dump_window_status_changes_ = false; bool LayoutTestController::dump_title_changes_ = false; bool LayoutTestController::accepts_editing_ = true; bool LayoutTestController::wait_until_done_ = false; @@ -58,7 +59,7 @@ CppVariant LayoutTestController::globalFlag_; CppVariant LayoutTestController::webHistoryItemCount_; LayoutTestController::LayoutTestController(TestShell* shell) { - // Set static shell_ variable since we can't do it in an initializer list. + // Set static shell_ variable since we can't do it in an initializer list. // We also need to be careful not to assign shell_ to new windows which are // temporary. if (NULL == shell_) @@ -75,6 +76,7 @@ LayoutTestController::LayoutTestController(TestShell* shell) { BindMethod("dumpBackForwardList", &LayoutTestController::dumpBackForwardList); BindMethod("dumpFrameLoadCallbacks", &LayoutTestController::dumpFrameLoadCallbacks); BindMethod("dumpResourceLoadCallbacks", &LayoutTestController::dumpResourceLoadCallbacks); + BindMethod("dumpStatusCallbacks", &LayoutTestController::dumpWindowStatusChanges); BindMethod("dumpTitleChanges", &LayoutTestController::dumpTitleChanges); BindMethod("setAcceptsEditing", &LayoutTestController::setAcceptsEditing); BindMethod("waitUntilDone", &LayoutTestController::waitUntilDone); @@ -184,7 +186,7 @@ void LayoutTestController::WorkQueue::AddWork(WorkItem* work) { queue_.push(work); } -void LayoutTestController::dumpAsText(const CppArgumentList& args, +void LayoutTestController::dumpAsText(const CppArgumentList& args, CppVariant* result) { dump_as_text_ = true; result->SetNull(); @@ -226,6 +228,12 @@ void LayoutTestController::dumpChildFramesAsText( result->SetNull(); } +void LayoutTestController::dumpWindowStatusChanges( + const CppArgumentList& args, CppVariant* result) { + dump_window_status_changes_ = true; + result->SetNull(); +} + void LayoutTestController::dumpTitleChanges( const CppArgumentList& args, CppVariant* result) { dump_title_changes_ = true; diff --git a/webkit/tools/test_shell/layout_test_controller.h b/webkit/tools/test_shell/layout_test_controller.h index 251524b72..384be54 100644 --- a/webkit/tools/test_shell/layout_test_controller.h +++ b/webkit/tools/test_shell/layout_test_controller.h @@ -3,7 +3,7 @@ // found in the LICENSE file. /* - LayoutTestController class: + LayoutTestController class: Bound to a JavaScript window.layoutTestController object using the CppBoundClass::BindToJavascript(), this allows layout tests that are run in the test_shell (or, in principle, any web page loaded into a client app built @@ -36,7 +36,7 @@ class LayoutTestController : public CppBoundClass { // descriptive test for each editing command. It takes no arguments, and // ignores any that may be present. void dumpEditingCallbacks(const CppArgumentList& args, CppVariant* result); - + // This function sets a flag that tells the test_shell to print a line of // descriptive test for each frame load callback. It takes no arguments, and // ignores any that may be present. @@ -55,6 +55,11 @@ class LayoutTestController : public CppBoundClass { // It takes no arguments, and ignores any that may be present. void dumpChildFramesAsText(const CppArgumentList& args, CppVariant* result); + // This function sets a flag that tells the test_shell to dump all calls + // to window.status(). + // It takes no arguments, and ignores any that may be present. + void dumpWindowStatusChanges(const CppArgumentList& args, CppVariant* result); + // When called with a boolean argument, this sets a flag that controls // whether content-editable elements accept editing focus when an editing // attempt is made. It ignores any additional arguments. @@ -99,11 +104,11 @@ class LayoutTestController : public CppBoundClass { // never be used by Chrome, but some layout tests depend on its presence. void setUseDashboardCompatibilityMode(const CppArgumentList& args, CppVariant* result); - // Causes navigation actions just printout the intended navigation instead + // Causes navigation actions just printout the intended navigation instead // of taking you to the page. This is used for cases like mailto, where you // don't actually want to open the mail program. void setCustomPolicyDelegate(const CppArgumentList& args, CppVariant* result); - + // Converts a URL starting with file:///tmp/ to the local mapping. void pathToLocalResource(const CppArgumentList& args, CppVariant* result); @@ -162,7 +167,7 @@ class LayoutTestController : public CppBoundClass { void setPrivateBrowsingEnabled(const CppArgumentList& args, CppVariant* result); // The fallback method is called when a nonexistent method is called on - // the layout test controller object. + // the layout test controller object. // It is usefull to catch typos in the JavaScript code (a few layout tests // do have typos in them) and it allows the script to continue running in // that case (as the Mac does). @@ -181,6 +186,9 @@ class LayoutTestController : public CppBoundClass { bool ShouldDumpResourceLoadCallbacks() { return dump_resource_load_callbacks_; } + bool ShouldDumpStatusCallbacks() { + return dump_window_status_changes_; + } bool ShouldDumpBackForwardList() { return dump_back_forward_list_; } bool ShouldDumpTitleChanges() { return dump_title_changes_; } bool ShouldDumpChildFrameScrollPositions() { @@ -205,7 +213,7 @@ class LayoutTestController : public CppBoundClass { // A single item in the work queue. class WorkItem { public: - virtual ~WorkItem() {}; + virtual ~WorkItem() {} virtual void Run(TestShell* shell) = 0; }; @@ -241,7 +249,7 @@ class LayoutTestController : public CppBoundClass { // Non-owning pointer. The LayoutTestController is owned by the host. static TestShell* shell_; - // If true, the test_shell will produce a plain text dump rather than a + // If true, the test_shell will produce a plain text dump rather than a // text representation of the renderer. static bool dump_as_text_; @@ -269,6 +277,9 @@ class LayoutTestController : public CppBoundClass { // dump all frames as plain text. static bool dump_child_frames_as_text_; + // If true, the test_shell will dump all changes to window.status. + static bool dump_window_status_changes_; + // If true, output a message when the page title is changed. static bool dump_title_changes_; diff --git a/webkit/tools/test_shell/test_webview_delegate.cc b/webkit/tools/test_shell/test_webview_delegate.cc index f04eebe..5f52911 100644 --- a/webkit/tools/test_shell/test_webview_delegate.cc +++ b/webkit/tools/test_shell/test_webview_delegate.cc @@ -384,12 +384,12 @@ void TestWebViewDelegate::AddMessageToConsole(WebView* webview, unsigned int line_no, const std::wstring& source_id) { if (!shell_->layout_test_mode()) { - logging::LogMessage("CONSOLE", 0).stream() << "\"" - << message.c_str() - << ",\" source: " - << source_id.c_str() - << "(" - << line_no + logging::LogMessage("CONSOLE", 0).stream() << "\"" + << message.c_str() + << ",\" source: " + << source_id.c_str() + << "(" + << line_no << ")"; } else { // This matches win DumpRenderTree's UIDelegate.cpp. @@ -443,6 +443,15 @@ bool TestWebViewDelegate::RunJavaScriptPrompt(WebView* webview, return false; } +void TestWebViewDelegate::SetStatusbarText(WebView* webview, + const std::wstring& message) { + if (webkit_glue::IsLayoutTestMode() && + shell_->layout_test_controller()->ShouldDumpStatusCallbacks()) { + // When running tests, write to stdout. + printf("UI DELEGATE STATUS CALLBACK: setStatusText:%S\n", message.c_str()); + } +} + void TestWebViewDelegate::StartDragging(WebView* webview, const WebDropData& drop_data) { if (webkit_glue::IsLayoutTestMode()) { @@ -488,28 +497,28 @@ void TestWebViewDelegate::ShowContextMenu(WebView* webview, // The output from these methods in layout test mode should match that // expected by the layout tests. See EditingDelegate.m in DumpRenderTree. -bool TestWebViewDelegate::ShouldBeginEditing(WebView* webview, +bool TestWebViewDelegate::ShouldBeginEditing(WebView* webview, std::wstring range) { if (shell_->ShouldDumpEditingCallbacks()) { std::string utf8 = WideToUTF8(range); - printf("EDITING DELEGATE: shouldBeginEditingInDOMRange:%s\n", + printf("EDITING DELEGATE: shouldBeginEditingInDOMRange:%s\n", utf8.c_str()); } return shell_->AcceptsEditing(); } -bool TestWebViewDelegate::ShouldEndEditing(WebView* webview, +bool TestWebViewDelegate::ShouldEndEditing(WebView* webview, std::wstring range) { if (shell_->ShouldDumpEditingCallbacks()) { std::string utf8 = WideToUTF8(range); - printf("EDITING DELEGATE: shouldEndEditingInDOMRange:%s\n", + printf("EDITING DELEGATE: shouldEndEditingInDOMRange:%s\n", utf8.c_str()); } return shell_->AcceptsEditing(); } -bool TestWebViewDelegate::ShouldInsertNode(WebView* webview, - std::wstring node, +bool TestWebViewDelegate::ShouldInsertNode(WebView* webview, + std::wstring node, std::wstring range, std::wstring action) { if (shell_->ShouldDumpEditingCallbacks()) { @@ -517,14 +526,14 @@ bool TestWebViewDelegate::ShouldInsertNode(WebView* webview, std::string utf8_range = WideToUTF8(range); std::string utf8_action = WideToUTF8(action); printf("EDITING DELEGATE: shouldInsertNode:%s " - "replacingDOMRange:%s givenAction:%s\n", + "replacingDOMRange:%s givenAction:%s\n", utf8_node.c_str(), utf8_range.c_str(), utf8_action.c_str()); } return shell_->AcceptsEditing(); } -bool TestWebViewDelegate::ShouldInsertText(WebView* webview, - std::wstring text, +bool TestWebViewDelegate::ShouldInsertText(WebView* webview, + std::wstring text, std::wstring range, std::wstring action) { if (shell_->ShouldDumpEditingCallbacks()) { @@ -532,32 +541,32 @@ bool TestWebViewDelegate::ShouldInsertText(WebView* webview, std::string utf8_range = WideToUTF8(range); std::string utf8_action = WideToUTF8(action); printf("EDITING DELEGATE: shouldInsertText:%s " - "replacingDOMRange:%s givenAction:%s\n", + "replacingDOMRange:%s givenAction:%s\n", utf8_text.c_str(), utf8_range.c_str(), utf8_action.c_str()); } return shell_->AcceptsEditing(); } -bool TestWebViewDelegate::ShouldChangeSelectedRange(WebView* webview, - std::wstring fromRange, - std::wstring toRange, - std::wstring affinity, +bool TestWebViewDelegate::ShouldChangeSelectedRange(WebView* webview, + std::wstring fromRange, + std::wstring toRange, + std::wstring affinity, bool stillSelecting) { if (shell_->ShouldDumpEditingCallbacks()) { std::string utf8_from = WideToUTF8(fromRange); std::string utf8_to = WideToUTF8(toRange); std::string utf8_affinity = WideToUTF8(affinity); printf("EDITING DELEGATE: shouldChangeSelectedDOMRange:%s " - "toDOMRange:%s affinity:%s stillSelecting:%s\n", - utf8_from.c_str(), - utf8_to.c_str(), + "toDOMRange:%s affinity:%s stillSelecting:%s\n", + utf8_from.c_str(), + utf8_to.c_str(), utf8_affinity.c_str(), (stillSelecting ? "TRUE" : "FALSE")); } return shell_->AcceptsEditing(); } -bool TestWebViewDelegate::ShouldDeleteRange(WebView* webview, +bool TestWebViewDelegate::ShouldDeleteRange(WebView* webview, std::wstring range) { if (shell_->ShouldDumpEditingCallbacks()) { std::string utf8 = WideToUTF8(range); @@ -566,13 +575,13 @@ bool TestWebViewDelegate::ShouldDeleteRange(WebView* webview, return shell_->AcceptsEditing(); } -bool TestWebViewDelegate::ShouldApplyStyle(WebView* webview, +bool TestWebViewDelegate::ShouldApplyStyle(WebView* webview, std::wstring style, std::wstring range) { if (shell_->ShouldDumpEditingCallbacks()) { std::string utf8_style = WideToUTF8(style); std::string utf8_range = WideToUTF8(range); - printf("EDITING DELEGATE: shouldApplyStyle:%s toElementsInDOMRange:%s\n", + printf("EDITING DELEGATE: shouldApplyStyle:%s toElementsInDOMRange:%s\n", utf8_style.c_str(), utf8_range.c_str()); } return shell_->AcceptsEditing(); @@ -600,7 +609,7 @@ void TestWebViewDelegate::SetSelectTrailingWhitespaceEnabled(bool enabled) { // allows both. } -void TestWebViewDelegate::DidBeginEditing() { +void TestWebViewDelegate::DidBeginEditing() { if (shell_->ShouldDumpEditingCallbacks()) { printf("EDITING DELEGATE: " "webViewDidBeginEditing:WebViewDidBeginEditingNotification\n"); diff --git a/webkit/tools/test_shell/test_webview_delegate.h b/webkit/tools/test_shell/test_webview_delegate.h index bc3836f..aa3e521 100644 --- a/webkit/tools/test_shell/test_webview_delegate.h +++ b/webkit/tools/test_shell/test_webview_delegate.h @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// TestWebViewDelegate class: +// TestWebViewDelegate class: // This class implements the WebViewDelegate methods for the test shell. One // instance is owned by each TestShell. @@ -55,7 +55,7 @@ class TestWebViewDelegate : public base::RefCounted<TestWebViewDelegate>, typedef std::vector<CapturedContextMenuEvent> CapturedContextMenuEvents; - TestWebViewDelegate(TestShell* shell) + TestWebViewDelegate(TestShell* shell) : is_custom_policy_delegate_(false), shell_(shell), top_loading_frame_(NULL), @@ -70,7 +70,7 @@ class TestWebViewDelegate : public base::RefCounted<TestWebViewDelegate>, #if defined(OS_LINUX) , cursor_type_(GDK_X_CURSOR) #endif - { + { } virtual ~TestWebViewDelegate(); @@ -95,6 +95,10 @@ class TestWebViewDelegate : public base::RefCounted<TestWebViewDelegate>, const std::wstring& message, const std::wstring& default_value, std::wstring* result); + + virtual void SetStatusbarText(WebView* webview, + const std::wstring& message); + virtual void AddMessageToConsole(WebView* webview, const std::wstring& message, unsigned int line_no, @@ -141,7 +145,7 @@ class TestWebViewDelegate : public base::RefCounted<TestWebViewDelegate>, const std::wstring& dest_url, unsigned int delay_seconds, unsigned int fire_date); - virtual void DidCancelClientRedirect(WebView* webview, + virtual void DidCancelClientRedirect(WebView* webview, WebFrame* frame); virtual void DidFinishLoadForFrame(WebView* webview, WebFrame* frame); @@ -162,21 +166,21 @@ class TestWebViewDelegate : public base::RefCounted<TestWebViewDelegate>, virtual bool ShouldBeginEditing(WebView* webview, std::wstring range); virtual bool ShouldEndEditing(WebView* webview, std::wstring range); - virtual bool ShouldInsertNode(WebView* webview, - std::wstring node, + virtual bool ShouldInsertNode(WebView* webview, + std::wstring node, std::wstring range, std::wstring action); - virtual bool ShouldInsertText(WebView* webview, - std::wstring text, + virtual bool ShouldInsertText(WebView* webview, + std::wstring text, std::wstring range, std::wstring action); - virtual bool ShouldChangeSelectedRange(WebView* webview, - std::wstring fromRange, - std::wstring toRange, - std::wstring affinity, + virtual bool ShouldChangeSelectedRange(WebView* webview, + std::wstring fromRange, + std::wstring toRange, + std::wstring affinity, bool stillSelecting); virtual bool ShouldDeleteRange(WebView* webview, std::wstring range); - virtual bool ShouldApplyStyle(WebView* webview, + virtual bool ShouldApplyStyle(WebView* webview, std::wstring style, std::wstring range); virtual bool SmartInsertDeleteEnabled(); @@ -213,11 +217,11 @@ class TestWebViewDelegate : public base::RefCounted<TestWebViewDelegate>, virtual void CloseWidgetSoon(WebWidget* webwidget); virtual void Focus(WebWidget* webwidget); virtual void Blur(WebWidget* webwidget); - virtual void SetCursor(WebWidget* webwidget, + virtual void SetCursor(WebWidget* webwidget, const WebCursor& cursor); virtual void GetWindowRect(WebWidget* webwidget, gfx::Rect* rect); virtual void SetWindowRect(WebWidget* webwidget, const gfx::Rect& rect); - virtual void GetRootWindowRect(WebWidget *,gfx::Rect *); + virtual void GetRootWindowRect(WebWidget *, gfx::Rect *); virtual void GetRootWindowResizerRect(WebWidget* webwidget, gfx::Rect* rect); virtual void DidMove(WebWidget* webwidget, const WebPluginGeometry& move); virtual void RunModal(WebWidget* webwidget); @@ -235,11 +239,11 @@ class TestWebViewDelegate : public base::RefCounted<TestWebViewDelegate>, IDropTarget* drop_delegate() { return drop_delegate_.get(); } IDropSource* drag_delegate() { return drag_delegate_.get(); } #endif - const CapturedContextMenuEvents& captured_context_menu_events() const { - return captured_context_menu_events_; + const CapturedContextMenuEvents& captured_context_menu_events() const { + return captured_context_menu_events_; } - void clear_captured_context_menu_events() { - captured_context_menu_events_.clear(); + void clear_captured_context_menu_events() { + captured_context_menu_events_.clear(); } // Methods for modifying WebPreferences @@ -283,7 +287,7 @@ class TestWebViewDelegate : public base::RefCounted<TestWebViewDelegate>, std::wstring GetFrameDescription(WebFrame* webframe); private: - // Causes navigation actions just printout the intended navigation instead + // Causes navigation actions just printout the intended navigation instead // of taking you to the page. This is used for cases like mailto, where you // don't actually want to open the mail program. bool is_custom_policy_delegate_; @@ -322,10 +326,10 @@ class TestWebViewDelegate : public base::RefCounted<TestWebViewDelegate>, // cursor. GdkCursorType cursor_type_; #endif - + CapturedContextMenuEvents captured_context_menu_events_; - DISALLOW_EVIL_CONSTRUCTORS(TestWebViewDelegate); + DISALLOW_COPY_AND_ASSIGN(TestWebViewDelegate); }; -#endif // WEBKIT_TOOLS_TEST_SHELL_TEST_WEBVIEW_DELEGATE_H_ +#endif // WEBKIT_TOOLS_TEST_SHELL_TEST_WEBVIEW_DELEGATE_H_ |