OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 COMPONENTS_AUTOFILL_CONTENT_RENDERER_PAGE_CLICK_LISTENER_H_ | 5 #ifndef COMPONENTS_AUTOFILL_CONTENT_RENDERER_PAGE_CLICK_LISTENER_H_ |
6 #define COMPONENTS_AUTOFILL_CONTENT_RENDERER_PAGE_CLICK_LISTENER_H_ | 6 #define COMPONENTS_AUTOFILL_CONTENT_RENDERER_PAGE_CLICK_LISTENER_H_ |
7 | 7 |
8 namespace blink { | 8 namespace blink { |
9 class WebInputElement; | 9 class WebFormControlElement; |
10 } | 10 } |
11 | 11 |
12 namespace autofill { | 12 namespace autofill { |
13 | 13 |
14 // Interface that should be implemented by classes interested in getting | 14 // Interface that should be implemented by classes interested in getting |
15 // notifications for clicks on a page. | 15 // notifications for clicks on a page. |
16 // Register on the PageListenerTracker object. | 16 // Register on the PageListenerTracker object. |
17 class PageClickListener { | 17 class PageClickListener { |
18 public: | 18 public: |
19 // Notification that |element| was clicked. | 19 // Notification that |element| was clicked. |
20 // |was_focused| is true if |element| had focus BEFORE the click. | 20 // |was_focused| is true if |element| had focus BEFORE the click. |
21 // |is_focused| is true if |element| has focus AFTER the click was processed. | 21 // |is_focused| is true if |element| has focus AFTER the click was processed. |
22 virtual void InputElementClicked(const blink::WebInputElement& element, | 22 virtual void FormControlElementClicked( |
23 bool was_focused, | 23 const blink::WebFormControlElement& element, |
24 bool is_focused) = 0; | 24 bool was_focused) = 0; |
25 | 25 |
26 // If the previously focused element was an input field, listeners are | 26 // If the previously focused element was an input field or a textarea, |
27 // informed that the text field has lost its focus. | 27 // listeners are informed that the text field has lost its focus. |
28 virtual void InputElementLostFocus() = 0; | 28 virtual void FormControlElementLostFocus() = 0; |
29 | 29 |
30 protected: | 30 protected: |
31 virtual ~PageClickListener() {} | 31 virtual ~PageClickListener() {} |
32 }; | 32 }; |
33 | 33 |
34 } // namespace autofill | 34 } // namespace autofill |
35 | 35 |
36 #endif // COMPONENTS_AUTOFILL_CONTENT_RENDERER_PAGE_CLICK_LISTENER_H_ | 36 #endif // COMPONENTS_AUTOFILL_CONTENT_RENDERER_PAGE_CLICK_LISTENER_H_ |
OLD | NEW |