virtual void Visit(CefRefPtr<CefDOMDocument> document) { // Register an click listener for the button. CefRefPtr<CefDOMNode> button = document->GetElementById("button"); ASSERT(button.get()); button->AddEventListener("click", new Listener(), false); }
void RegisterClickListener(CefRefPtr<CefDOMDocument> document, CefRefPtr<CefDOMEventListener> listener, const std::string& elementId) { CefRefPtr<CefDOMNode> element = document->GetElementById(elementId); ASSERT(element.get()); element->AddEventListener("click", listener, false); }