From 5ae8ce17da13ea2755858d834c4e7e890534a069 Mon Sep 17 00:00:00 2001 From: "darin@chromium.org" Date: Sat, 5 Sep 2009 04:20:31 +0000 Subject: Some cleanup to various WebCore client implementations. Replaced usage of MessageLoop in EditorClientImpl with WebCore::Timer. Changed the clients to be instance variables of WebViewImpl instead of being separately heap allocated. This cleaned up some of the lifetime issues. R=dglazkov Review URL: http://codereview.chromium.org/198030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25573 0039d316-1c4b-4281-b951-d872f2087c98 --- webkit/glue/editor_client_impl.h | 54 +++++++++++++++++++++------------------- 1 file changed, 28 insertions(+), 26 deletions(-) (limited to 'webkit/glue/editor_client_impl.h') diff --git a/webkit/glue/editor_client_impl.h b/webkit/glue/editor_client_impl.h index 1ca7ce1..c2712a9 100644 --- a/webkit/glue/editor_client_impl.h +++ b/webkit/glue/editor_client_impl.h @@ -5,12 +5,10 @@ #ifndef WEBKIT_GLUE_EDITOR_CLIENT_IMPL_H__ #define WEBKIT_GLUE_EDITOR_CLIENT_IMPL_H__ -#include - #include "DOMWindow.h" #include "EditorClient.h" - -#include "base/task.h" +#include "Timer.h" +#include namespace WebCore { class Frame; @@ -29,8 +27,6 @@ class EditorClientImpl : public WebCore::EditorClient { EditorClientImpl(WebViewImpl* web_view, WebKit::WebEditingClient* editing_client); - void DropEditingClient() { editing_client_ = NULL; } - virtual ~EditorClientImpl(); virtual void pageDestroyed(); @@ -142,26 +138,15 @@ class EditorClientImpl : public WebCore::EditorClient { bool autofill_on_empty_value, bool requires_caret_at_end); - // This method is invoked later by Autofill() as when Autofill() is invoked - // (from one of the EditorClient callback) the carret position is not - // reflecting the last text change yet and we need it to decide whether or not - // to show the autofill popup. - void DoAutofill(WebCore::HTMLInputElement* input_element, - bool form_autofill_only, - bool autofill_on_empty_value, - bool requires_caret_at_end, - bool backspace); - - protected: - WebViewImpl* web_view_; - WebKit::WebEditingClient* editing_client_; - bool in_redo_; + private: + // Called to process the autofill described by autofill_args_. + // This method is invoked asynchronously if the caret position is not + // reflecting the last text change yet, and we need it to decide whether or + // not to show the autofill popup. + void DoAutofill(WebCore::Timer*); - typedef std::deque > EditCommandStack; - EditCommandStack undo_stack_; - EditCommandStack redo_stack_; + void CancelPendingAutofill(); - private: // Returns whether or not the focused control needs spell-checking. // Currently, this function just retrieves the focused node and determines // whether or not it is a