| 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_TRACKER_H_ | 5 #ifndef COMPONENTS_AUTOFILL_CONTENT_RENDERER_PAGE_CLICK_TRACKER_H_ |
| 6 #define COMPONENTS_AUTOFILL_CONTENT_RENDERER_PAGE_CLICK_TRACKER_H_ | 6 #define COMPONENTS_AUTOFILL_CONTENT_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 24 matching lines...) Expand all Loading... |
| 35 | 35 |
| 36 private: | 36 private: |
| 37 // TODO(estade): migrate this stuff to content::RenderFrameObserver, and | 37 // TODO(estade): migrate this stuff to content::RenderFrameObserver, and |
| 38 // remove this class. | 38 // remove this class. |
| 39 class Legacy : public content::RenderViewObserver { | 39 class Legacy : public content::RenderViewObserver { |
| 40 public: | 40 public: |
| 41 Legacy(PageClickTracker* tracker); | 41 Legacy(PageClickTracker* tracker); |
| 42 | 42 |
| 43 // RenderViewObserver implementation. | 43 // RenderViewObserver implementation. |
| 44 void OnDestruct() override; | 44 void OnDestruct() override; |
| 45 void DidHandleMouseEvent(const blink::WebMouseEvent& event) override; | 45 void OnMouseDown(const blink::WebNode& mouse_down_node) override; |
| 46 void DidHandleGestureEvent(const blink::WebGestureEvent& event) override; | |
| 47 void FocusChangeComplete() override; | 46 void FocusChangeComplete() override; |
| 48 | 47 |
| 49 private: | 48 private: |
| 50 PageClickTracker* tracker_; | 49 PageClickTracker* tracker_; |
| 51 }; | 50 }; |
| 52 friend class Legacy; | 51 friend class Legacy; |
| 53 | 52 |
| 54 // RenderFrameObserver implementation. | 53 // RenderFrameObserver implementation. |
| 55 void FocusedNodeChanged(const blink::WebNode& node) override; | 54 void FocusedNodeChanged(const blink::WebNode& node) override; |
| 56 | 55 |
| 57 // RenderViewObserver methods forwarded from Legacy. Should be | 56 // RenderViewObserver methods forwarded from Legacy. Should be |
| 58 // merged into RenderFrameObserver. | 57 // merged into RenderFrameObserver. |
| 59 void DidHandleMouseEvent(const blink::WebMouseEvent& event); | 58 void OnMouseDown(const blink::WebNode& mouse_down_node); |
| 60 void DidHandleGestureEvent(const blink::WebGestureEvent& event); | |
| 61 void FocusChangeComplete(); | 59 void FocusChangeComplete(); |
| 62 void DoFocusChangeComplete(); | 60 void DoFocusChangeComplete(); |
| 63 | 61 |
| 64 // True when the last click was on the focused node. | 62 // True when the last click was on the focused node. |
| 65 bool focused_node_was_last_clicked_; | 63 bool focused_node_was_last_clicked_; |
| 66 | 64 |
| 67 // This is set to false when the focus changes, then set back to true soon | 65 // This is set to false when the focus changes, then set back to true soon |
| 68 // afterwards. This helps track whether an event happened after a node was | 66 // afterwards. This helps track whether an event happened after a node was |
| 69 // already focused, or if it caused the focus to change. | 67 // already focused, or if it caused the focus to change. |
| 70 bool was_focused_before_now_; | 68 bool was_focused_before_now_; |
| 71 | 69 |
| 72 // The listener getting the actual notifications. | 70 // The listener getting the actual notifications. |
| 73 PageClickListener* listener_; | 71 PageClickListener* listener_; |
| 74 | 72 |
| 75 Legacy legacy_; | 73 Legacy legacy_; |
| 76 | 74 |
| 77 DISALLOW_COPY_AND_ASSIGN(PageClickTracker); | 75 DISALLOW_COPY_AND_ASSIGN(PageClickTracker); |
| 78 }; | 76 }; |
| 79 | 77 |
| 80 } // namespace autofill | 78 } // namespace autofill |
| 81 | 79 |
| 82 #endif // COMPONENTS_AUTOFILL_CONTENT_RENDERER_PAGE_CLICK_TRACKER_H_ | 80 #endif // COMPONENTS_AUTOFILL_CONTENT_RENDERER_PAGE_CLICK_TRACKER_H_ |
| OLD | NEW |