Index: chrome/browser/autocomplete/autocomplete_edit_view_win.h |
=================================================================== |
--- chrome/browser/autocomplete/autocomplete_edit_view_win.h (revision 50055) |
+++ chrome/browser/autocomplete/autocomplete_edit_view_win.h (working copy) |
@@ -170,15 +170,17 @@ |
MSG_WM_LBUTTONDBLCLK(OnLButtonDblClk) |
MSG_WM_LBUTTONDOWN(OnLButtonDown) |
MSG_WM_LBUTTONUP(OnLButtonUp) |
- MSG_WM_MBUTTONDOWN(OnNonLButtonDown) |
- MSG_WM_MBUTTONUP(OnNonLButtonUp) |
+ MSG_WM_MBUTTONDBLCLK(OnMButtonDblClk) |
+ MSG_WM_MBUTTONDOWN(OnMButtonDown) |
+ MSG_WM_MBUTTONUP(OnMButtonUp) |
MSG_WM_MOUSEACTIVATE(OnMouseActivate) |
MSG_WM_MOUSEMOVE(OnMouseMove) |
MSG_WM_MOUSEWHEEL(OnMouseWheel) |
MSG_WM_PAINT(OnPaint) |
MSG_WM_PASTE(OnPaste) |
- MSG_WM_RBUTTONDOWN(OnNonLButtonDown) |
- MSG_WM_RBUTTONUP(OnNonLButtonUp) |
+ MSG_WM_RBUTTONDBLCLK(OnRButtonDblClk) |
+ MSG_WM_RBUTTONDOWN(OnRButtonDown) |
+ MSG_WM_RBUTTONUP(OnRButtonUp) |
MSG_WM_SETFOCUS(OnSetFocus) |
MSG_WM_SETTEXT(OnSetText) |
MSG_WM_SYSCHAR(OnSysChar) // WM_SYSxxx == WM_xxx with ALT down |
@@ -198,6 +200,11 @@ |
virtual void ExecuteCommand(int command_id); |
private: |
+ enum MouseButton { |
+ kLeft = 0, |
+ kRight = 1, |
+ }; |
+ |
// This object freezes repainting of the edit until the object is destroyed. |
// Some methods of the CRichEditCtrl draw synchronously to the screen. If we |
// don't freeze, the user will see a rapid series of calls to these as |
@@ -256,13 +263,17 @@ |
void OnLButtonDblClk(UINT keys, const CPoint& point); |
void OnLButtonDown(UINT keys, const CPoint& point); |
void OnLButtonUp(UINT keys, const CPoint& point); |
+ void OnMButtonDblClk(UINT keys, const CPoint& point); |
+ void OnMButtonDown(UINT keys, const CPoint& point); |
+ void OnMButtonUp(UINT keys, const CPoint& point); |
LRESULT OnMouseActivate(HWND window, UINT hit_test, UINT mouse_message); |
void OnMouseMove(UINT keys, const CPoint& point); |
BOOL OnMouseWheel(UINT flags, short delta, CPoint point); |
- void OnNonLButtonDown(UINT keys, const CPoint& point); |
- void OnNonLButtonUp(UINT keys, const CPoint& point); |
void OnPaint(HDC bogus_hdc); |
void OnPaste(); |
+ void OnRButtonDblClk(UINT keys, const CPoint& point); |
+ void OnRButtonDown(UINT keys, const CPoint& point); |
+ void OnRButtonUp(UINT keys, const CPoint& point); |
void OnSetFocus(HWND focus_wnd); |
LRESULT OnSetText(const wchar_t* text); |
void OnSysChar(TCHAR ch, UINT repeat_count, UINT flags); |
@@ -361,10 +372,6 @@ |
// user moves the mouse far enough to start a drag. |
void OnPossibleDrag(const CPoint& point); |
- // Invoked when a mouse button is released. If none of the buttons are still |
- // down, this sets possible_drag_ to false. |
- void UpdateDragDone(UINT keys); |
- |
// Redraws the necessary region for a drop highlight at the specified |
// position. This does nothing if position is beyond the bounds of the |
// text. |
@@ -373,6 +380,9 @@ |
// Generates the context menu for the edit field. |
void BuildContextMenu(); |
+ void SelectAllIfNecessary(MouseButton button, const CPoint& point); |
+ void TrackMousePosition(MouseButton button, const CPoint& point); |
+ |
scoped_ptr<AutocompleteEditModel> model_; |
scoped_ptr<AutocompletePopupView> popup_view_; |
@@ -412,12 +422,13 @@ |
// When the user clicks to give us focus, we watch to see if they're clicking |
// or dragging. When they're clicking, we select nothing until mouseup, then |
- // select all the text in the edit. During this process, tracking_click_ is |
- // true and mouse_down_point_ holds the original click location. At other |
- // times, tracking_click_ is false, and the contents of mouse_down_point_ |
- // should be ignored. |
- bool tracking_click_; |
- CPoint mouse_down_point_; |
+ // select all the text in the edit. During this process, tracking_click_[X] |
+ // is true and click_point_[X] holds the original click location. |
+ // At other times, tracking_click_[X] is false, and the contents of |
+ // click_point_[X] should be ignored. The arrays hold the state for the |
+ // left and right mouse buttons, and are indexed using the MouseButton enum. |
+ bool tracking_click_[2]; |
+ CPoint click_point_[2]; |
// We need to know if the user triple-clicks, so track double click points |
// and times so we can see if subsequent clicks are actually triple clicks. |