| 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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 autofill popup for |node| if it is an HTMLInputElement and it is |
| 119 // empty. This is called when you press the up or down arrow in a text field | 119 // empty. This is called when you press the up or down arrow in a text field |
| 120 // or when clicking an already focused text-field. | 120 // or when clicking an already focused text-field. |
| 121 virtual void ShowAutofillForNode(WebCore::Node* node); | 121 // Returns true if the autofill popup has been scheduled to be shown, false |
| 122 // otherwise. |
| 123 virtual bool ShowAutofillForNode(WebCore::Node* node); |
| 122 | 124 |
| 123 private: | 125 private: |
| 124 void ModifySelection(WebCore::Frame* frame, | 126 void ModifySelection(WebCore::Frame* frame, |
| 125 WebCore::KeyboardEvent* event); | 127 WebCore::KeyboardEvent* event); |
| 126 | 128 |
| 127 // Popups an autofill menu for |input_element| is applicable. | 129 // Popups an autofill menu for |input_element| is applicable. |
| 128 // |autofill_on_empty_value| indicates whether the autofill should be shown | 130 // |autofill_on_empty_value| indicates whether the autofill should be shown |
| 129 // when the text-field is empty. | 131 // when the text-field is empty. |
| 130 void Autofill(WebCore::HTMLInputElement* input_element, | 132 // Returns true if the autofill popup has been scheduled to be shown, false |
| 133 // otherwise. |
| 134 bool Autofill(WebCore::HTMLInputElement* input_element, |
| 131 bool autofill_on_empty_value); | 135 bool autofill_on_empty_value); |
| 132 | 136 |
| 133 // This method is invoked later by Autofill() as when Autofill() is invoked | 137 // This method is invoked later by Autofill() as when Autofill() is invoked |
| 134 // (from one of the EditorClient callback) the carret position is not | 138 // (from one of the EditorClient callback) the carret position is not |
| 135 // reflecting the last text change yet and we need it to decide whether or not | 139 // reflecting the last text change yet and we need it to decide whether or not |
| 136 // to show the autofill popup. | 140 // to show the autofill popup. |
| 137 void DoAutofill(WebCore::HTMLInputElement* input_element, | 141 void DoAutofill(WebCore::HTMLInputElement* input_element, |
| 138 bool autofill_on_empty_value, | 142 bool autofill_on_empty_value, |
| 139 bool backspace); | 143 bool backspace); |
| 140 | 144 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 167 SPELLCHECK_FORCED_ON, | 171 SPELLCHECK_FORCED_ON, |
| 168 SPELLCHECK_FORCED_OFF | 172 SPELLCHECK_FORCED_OFF |
| 169 }; | 173 }; |
| 170 int spell_check_this_field_status_; | 174 int spell_check_this_field_status_; |
| 171 | 175 |
| 172 // The method factory used to post autofill related tasks. | 176 // The method factory used to post autofill related tasks. |
| 173 ScopedRunnableMethodFactory<EditorClientImpl> autofill_factory_; | 177 ScopedRunnableMethodFactory<EditorClientImpl> autofill_factory_; |
| 174 }; | 178 }; |
| 175 | 179 |
| 176 #endif // WEBKIT_GLUE_EDITOR_CLIENT_IMPL_H__ | 180 #endif // WEBKIT_GLUE_EDITOR_CLIENT_IMPL_H__ |
| OLD | NEW |