| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef WEBKIT_GLUE_EDITOR_CLIENT_IMPL_H__ | 5 #ifndef WEBKIT_GLUE_EDITOR_CLIENT_IMPL_H__ |
| 6 #define WEBKIT_GLUE_EDITOR_CLIENT_IMPL_H__ | 6 #define WEBKIT_GLUE_EDITOR_CLIENT_IMPL_H__ |
| 7 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 | 9 |
| 10 #include "DOMWindow.h" | 10 #include "DOMWindow.h" |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 virtual std::wstring DescribeOrError(int number, | 108 virtual std::wstring DescribeOrError(int number, |
| 109 WebCore::ExceptionCode ec); | 109 WebCore::ExceptionCode ec); |
| 110 virtual std::wstring DescribeOrError(WebCore::Node* node, | 110 virtual std::wstring DescribeOrError(WebCore::Node* node, |
| 111 WebCore::ExceptionCode ec); | 111 WebCore::ExceptionCode ec); |
| 112 virtual std::wstring Describe(WebCore::Range* range); | 112 virtual std::wstring Describe(WebCore::Range* range); |
| 113 virtual std::wstring Describe(WebCore::Node* node); | 113 virtual std::wstring Describe(WebCore::Node* node); |
| 114 virtual std::wstring Describe(WebCore::EditorInsertAction action); | 114 virtual std::wstring Describe(WebCore::EditorInsertAction action); |
| 115 virtual std::wstring Describe(WebCore::EAffinity affinity); | 115 virtual std::wstring Describe(WebCore::EAffinity affinity); |
| 116 virtual std::wstring Describe(WebCore::CSSStyleDeclaration* style); | 116 virtual std::wstring Describe(WebCore::CSSStyleDeclaration* style); |
| 117 | 117 |
| 118 // Shows the autofill popup for |node| if it is an HTMLInputElement and it is | 118 // Shows the form autofill popup for |node| if it is an HTMLInputElement and |
| 119 // empty. This is called when you press the up or down arrow in a text field | 119 // it is empty. This is called when you press the up or down arrow in a |
| 120 // or when clicking an already focused text-field. | 120 // text-field or when clicking an already focused text-field. |
| 121 // Returns true if the autofill popup has been scheduled to be shown, false | 121 // Returns true if the autofill popup has been scheduled to be shown, false |
| 122 // otherwise. | 122 // otherwise. |
| 123 virtual bool ShowAutofillForNode(WebCore::Node* node); | 123 virtual bool ShowFormAutofillForNode(WebCore::Node* node); |
| 124 | 124 |
| 125 private: | 125 private: |
| 126 void ModifySelection(WebCore::Frame* frame, | 126 void ModifySelection(WebCore::Frame* frame, |
| 127 WebCore::KeyboardEvent* event); | 127 WebCore::KeyboardEvent* event); |
| 128 | 128 |
| 129 // Popups an autofill menu for |input_element| is applicable. | 129 // Triggers autofill for |input_element| if applicable. This can be form |
| 130 // autofill (via a popup-menu) or password autofill depending on |
| 131 // |input_element|. If |form_autofill_only| is true, password autofill is not |
| 132 // triggered. |
| 130 // |autofill_on_empty_value| indicates whether the autofill should be shown | 133 // |autofill_on_empty_value| indicates whether the autofill should be shown |
| 131 // when the text-field is empty. | 134 // when the text-field is empty. |
| 132 // If |requires_caret_at_end| is true, the autofill popup is only shown if the | 135 // If |requires_caret_at_end| is true, the autofill popup is only shown if the |
| 133 // caret is located at the end of the entered text in |input_element|. | 136 // caret is located at the end of the entered text in |input_element|. |
| 134 // Returns true if the autofill popup has been scheduled to be shown, false | 137 // Returns true if the autofill popup has been scheduled to be shown, false |
| 135 // otherwise. | 138 // otherwise. |
| 136 bool Autofill(WebCore::HTMLInputElement* input_element, | 139 bool Autofill(WebCore::HTMLInputElement* input_element, |
| 140 bool form_autofill_only, |
| 137 bool autofill_on_empty_value, | 141 bool autofill_on_empty_value, |
| 138 bool requires_caret_at_end); | 142 bool requires_caret_at_end); |
| 139 | 143 |
| 140 // This method is invoked later by Autofill() as when Autofill() is invoked | 144 // This method is invoked later by Autofill() as when Autofill() is invoked |
| 141 // (from one of the EditorClient callback) the carret position is not | 145 // (from one of the EditorClient callback) the carret position is not |
| 142 // reflecting the last text change yet and we need it to decide whether or not | 146 // reflecting the last text change yet and we need it to decide whether or not |
| 143 // to show the autofill popup. | 147 // to show the autofill popup. |
| 144 void DoAutofill(WebCore::HTMLInputElement* input_element, | 148 void DoAutofill(WebCore::HTMLInputElement* input_element, |
| 149 bool form_autofill_only, |
| 145 bool autofill_on_empty_value, | 150 bool autofill_on_empty_value, |
| 146 bool requires_caret_at_end, | 151 bool requires_caret_at_end, |
| 147 bool backspace); | 152 bool backspace); |
| 148 | 153 |
| 149 protected: | 154 protected: |
| 150 WebViewImpl* web_view_; | 155 WebViewImpl* web_view_; |
| 151 bool use_editor_delegate_; | 156 bool use_editor_delegate_; |
| 152 bool in_redo_; | 157 bool in_redo_; |
| 153 | 158 |
| 154 typedef std::deque<WTF::RefPtr<WebCore::EditCommand> > EditCommandStack; | 159 typedef std::deque<WTF::RefPtr<WebCore::EditCommand> > EditCommandStack; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 175 SPELLCHECK_FORCED_ON, | 180 SPELLCHECK_FORCED_ON, |
| 176 SPELLCHECK_FORCED_OFF | 181 SPELLCHECK_FORCED_OFF |
| 177 }; | 182 }; |
| 178 int spell_check_this_field_status_; | 183 int spell_check_this_field_status_; |
| 179 | 184 |
| 180 // The method factory used to post autofill related tasks. | 185 // The method factory used to post autofill related tasks. |
| 181 ScopedRunnableMethodFactory<EditorClientImpl> autofill_factory_; | 186 ScopedRunnableMethodFactory<EditorClientImpl> autofill_factory_; |
| 182 }; | 187 }; |
| 183 | 188 |
| 184 #endif // WEBKIT_GLUE_EDITOR_CLIENT_IMPL_H__ | 189 #endif // WEBKIT_GLUE_EDITOR_CLIENT_IMPL_H__ |
| OLD | NEW |