Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(51)

Side by Side Diff: components/autofill/content/renderer/page_click_tracker.h

Issue 1195473005: Let PageClickTracker use onMouseDown (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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); 59 void DidHandleGestureEvent(const blink::WebGestureEvent& event);
Ilya Sherman 2015/06/18 21:58:16 nit: Please remove this. (It looks like you alrea
Yufeng Shen (Slow to review) 2015/06/19 00:08:32 Done.
61 void FocusChangeComplete(); 60 void FocusChangeComplete();
62 void DoFocusChangeComplete(); 61 void DoFocusChangeComplete();
63 62
64 // True when the last click was on the focused node. 63 // True when the last click was on the focused node.
65 bool focused_node_was_last_clicked_; 64 bool focused_node_was_last_clicked_;
66 65
67 // 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
68 // 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
69 // already focused, or if it caused the focus to change. 68 // already focused, or if it caused the focus to change.
70 bool was_focused_before_now_; 69 bool was_focused_before_now_;
71 70
72 // The listener getting the actual notifications. 71 // The listener getting the actual notifications.
73 PageClickListener* listener_; 72 PageClickListener* listener_;
74 73
75 Legacy legacy_; 74 Legacy legacy_;
76 75
77 DISALLOW_COPY_AND_ASSIGN(PageClickTracker); 76 DISALLOW_COPY_AND_ASSIGN(PageClickTracker);
78 }; 77 };
79 78
80 } // namespace autofill 79 } // namespace autofill
81 80
82 #endif // COMPONENTS_AUTOFILL_CONTENT_RENDERER_PAGE_CLICK_TRACKER_H_ 81 #endif // COMPONENTS_AUTOFILL_CONTENT_RENDERER_PAGE_CLICK_TRACKER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698