page_click_listener.h revision a1401311d1ab56c4ed0a474bd38c108f75cb0cd9
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 3// found in the LICENSE file. 4 5#ifndef COMPONENTS_AUTOFILL_CONTENT_RENDERER_PAGE_CLICK_LISTENER_H_ 6#define COMPONENTS_AUTOFILL_CONTENT_RENDERER_PAGE_CLICK_LISTENER_H_ 7 8namespace blink { 9class WebFormControlElement; 10} 11 12namespace autofill { 13 14// Interface that should be implemented by classes interested in getting 15// notifications for clicks on a page. 16// Register on the PageListenerTracker object. 17class PageClickListener { 18 public: 19 // Notification that |element| was clicked. 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. 22 virtual void FormControlElementClicked( 23 const blink::WebFormControlElement& element, 24 bool was_focused) = 0; 25 26 // If the previously focused element was an input field or a textarea, 27 // listeners are informed that the text field has lost its focus. 28 virtual void FormControlElementLostFocus() = 0; 29 30 protected: 31 virtual ~PageClickListener() {} 32}; 33 34} // namespace autofill 35 36#endif // COMPONENTS_AUTOFILL_CONTENT_RENDERER_PAGE_CLICK_LISTENER_H_ 37