OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_RENDERER_PAGE_CLICK_TRACKER_H_ | 5 #ifndef COMPONENTS_AUTOFILL_RENDERER_PAGE_CLICK_TRACKER_H_ |
6 #define COMPONENTS_AUTOFILL_RENDERER_PAGE_CLICK_TRACKER_H_ | 6 #define COMPONENTS_AUTOFILL_RENDERER_PAGE_CLICK_TRACKER_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 // The |listener| will be notified when an element is clicked. It must | 34 // The |listener| will be notified when an element is clicked. It must |
35 // outlive this class. | 35 // outlive this class. |
36 PageClickTracker(content::RenderView* render_view, | 36 PageClickTracker(content::RenderView* render_view, |
37 PageClickListener* listener); | 37 PageClickListener* listener); |
38 virtual ~PageClickTracker(); | 38 virtual ~PageClickTracker(); |
39 | 39 |
40 private: | 40 private: |
41 // RenderView::Observer implementation. | 41 // RenderView::Observer implementation. |
42 virtual void DidFinishDocumentLoad(WebKit::WebFrame* frame) OVERRIDE; | 42 virtual void DidFinishDocumentLoad(WebKit::WebFrame* frame) OVERRIDE; |
43 virtual void FrameDetached(WebKit::WebFrame* frame) OVERRIDE; | 43 virtual void FrameDetached(WebKit::WebFrame* frame) OVERRIDE; |
44 virtual void DidHandleMouseEvent(const WebKit::WebMouseEvent& event) OVERRIDE; | 44 virtual void DidHandleMouseEvent( |
| 45 const WebKit::WebMouseEvent& event) OVERRIDE; |
| 46 virtual void DidHandleGestureEvent( |
| 47 const WebKit::WebGestureEvent& event) OVERRIDE; |
45 | 48 |
46 // WebKit::WebDOMEventListener implementation. | 49 // WebKit::WebDOMEventListener implementation. |
47 virtual void handleEvent(const WebKit::WebDOMEvent& event); | 50 virtual void handleEvent(const WebKit::WebDOMEvent& event); |
48 | 51 |
49 // Checks to see if a text field is losing focus and inform listeners if | 52 // Checks to see if a text field is losing focus and inform listeners if |
50 // it is. | 53 // it is. |
51 void HandleTextFieldMaybeLosingFocus( | 54 void HandleTextFieldMaybeLosingFocus( |
52 const WebKit::WebNode& newly_clicked_node); | 55 const WebKit::WebNode& newly_clicked_node); |
53 | 56 |
54 // The last node that was clicked and had focus. | 57 // The last node that was clicked and had focus. |
55 WebKit::WebNode last_node_clicked_; | 58 WebKit::WebNode last_node_clicked_; |
56 | 59 |
57 // Whether the last clicked node had focused before it was clicked. | 60 // Whether the last clicked node had focused before it was clicked. |
58 bool was_focused_; | 61 bool was_focused_; |
59 | 62 |
60 // The frames we are listening to for mouse events. | 63 // The frames we are listening to for mouse events. |
61 std::vector<WebKit::WebFrame*> tracked_frames_; | 64 std::vector<WebKit::WebFrame*> tracked_frames_; |
62 | 65 |
63 // The listener getting the actual notifications. | 66 // The listener getting the actual notifications. |
64 PageClickListener* listener_; | 67 PageClickListener* listener_; |
65 | 68 |
66 DISALLOW_COPY_AND_ASSIGN(PageClickTracker); | 69 DISALLOW_COPY_AND_ASSIGN(PageClickTracker); |
67 }; | 70 }; |
68 | 71 |
69 } // namespace autofill | 72 } // namespace autofill |
70 | 73 |
71 #endif // COMPONENTS_AUTOFILL_RENDERER_PAGE_CLICK_TRACKER_H_ | 74 #endif // COMPONENTS_AUTOFILL_RENDERER_PAGE_CLICK_TRACKER_H_ |
OLD | NEW |