| 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/macros.h" | 10 #include "base/macros.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 void OnMouseDown(const blink::WebNode& mouse_down_node) override; | 45 void OnMouseDown(const blink::WebNode& mouse_down_node) override; |
| 46 void FocusChangeComplete() override; | 46 void FocusChangeComplete() override; |
| 47 | 47 |
| 48 private: | 48 private: |
| 49 PageClickTracker* tracker_; | 49 PageClickTracker* tracker_; |
| 50 }; | 50 }; |
| 51 friend class Legacy; | 51 friend class Legacy; |
| 52 | 52 |
| 53 // RenderFrameObserver implementation. | 53 // RenderFrameObserver implementation. |
| 54 void FocusedNodeChanged(const blink::WebNode& node) override; | 54 void FocusedNodeChanged(const blink::WebNode& node) override; |
| 55 void OnDestruct() override; |
| 55 | 56 |
| 56 // RenderViewObserver methods forwarded from Legacy. Should be | 57 // RenderViewObserver methods forwarded from Legacy. Should be |
| 57 // merged into RenderFrameObserver. | 58 // merged into RenderFrameObserver. |
| 58 void OnMouseDown(const blink::WebNode& mouse_down_node); | 59 void OnMouseDown(const blink::WebNode& mouse_down_node); |
| 59 void FocusChangeComplete(); | 60 void FocusChangeComplete(); |
| 60 void DoFocusChangeComplete(); | 61 void DoFocusChangeComplete(); |
| 61 | 62 |
| 62 // True when the last click was on the focused node. | 63 // True when the last click was on the focused node. |
| 63 bool focused_node_was_last_clicked_; | 64 bool focused_node_was_last_clicked_; |
| 64 | 65 |
| 65 // This is set to false when the focus changes, then set back to true soon | 66 // This is set to false when the focus changes, then set back to true soon |
| 66 // afterwards. This helps track whether an event happened after a node was | 67 // afterwards. This helps track whether an event happened after a node was |
| 67 // already focused, or if it caused the focus to change. | 68 // already focused, or if it caused the focus to change. |
| 68 bool was_focused_before_now_; | 69 bool was_focused_before_now_; |
| 69 | 70 |
| 70 // The listener getting the actual notifications. | 71 // The listener getting the actual notifications. |
| 71 PageClickListener* listener_; | 72 PageClickListener* listener_; |
| 72 | 73 |
| 73 Legacy legacy_; | 74 Legacy legacy_; |
| 74 | 75 |
| 75 DISALLOW_COPY_AND_ASSIGN(PageClickTracker); | 76 DISALLOW_COPY_AND_ASSIGN(PageClickTracker); |
| 76 }; | 77 }; |
| 77 | 78 |
| 78 } // namespace autofill | 79 } // namespace autofill |
| 79 | 80 |
| 80 #endif // COMPONENTS_AUTOFILL_CONTENT_RENDERER_PAGE_CLICK_TRACKER_H_ | 81 #endif // COMPONENTS_AUTOFILL_CONTENT_RENDERER_PAGE_CLICK_TRACKER_H_ |
| OLD | NEW |