void NativeTextfieldWin::OnContextMenu(HWND window, const gfx::Point& point) { POINT p = point.ToPOINT(); if(p.x==-1 || p.y==-1) { GetCaretPos(&p); MapWindowPoints(HWND_DESKTOP, &p, 1); } BuildContextMenu(); context_menu_->RunContextMenuAt(gfx::Point(p)); }
void NativeTextfieldWin::OnLButtonDown(UINT keys, const gfx::Point& point) { // Check for triple click, then reset tracker. Should be safe to subtract // double_click_time_ from the current message's time even if the timer has // wrapped in between. const bool is_triple_click = tracking_double_click_ && IsDoubleClick(double_click_point_.ToPOINT(), point.ToPOINT(), GetCurrentMessage()->time-double_click_time_); tracking_double_click_ = false; ScopedFreeze freeze(this, GetTextObjectModel()); OnBeforePossibleChange(); DefWindowProc(WM_LBUTTONDOWN, keys, MAKELPARAM(ClipXCoordToVisibleText(point.x(), is_triple_click), point.y())); OnAfterPossibleChange(true); }