| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 VIEWS_WIDGET_WIDGET_WIN_H_ | 5 #ifndef VIEWS_WIDGET_WIDGET_WIN_H_ |
| 6 #define VIEWS_WIDGET_WIDGET_WIN_H_ | 6 #define VIEWS_WIDGET_WIDGET_WIN_H_ |
| 7 | 7 |
| 8 #include <atlbase.h> | 8 #include <atlbase.h> |
| 9 #include <atlapp.h> | 9 #include <atlapp.h> |
| 10 #include <atlcrack.h> | 10 #include <atlcrack.h> |
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 // that disregards duplicate mouse moves when ending animation requires | 296 // that disregards duplicate mouse moves when ending animation requires |
| 297 // a new hit-test to do some highlighting as in TabStrip::RemoveTabAnimation | 297 // a new hit-test to do some highlighting as in TabStrip::RemoveTabAnimation |
| 298 // to cause the close button to highlight. | 298 // to cause the close button to highlight. |
| 299 void ResetLastMouseMoveFlag() { | 299 void ResetLastMouseMoveFlag() { |
| 300 last_mouse_event_was_move_ = false; | 300 last_mouse_event_was_move_ = false; |
| 301 } | 301 } |
| 302 | 302 |
| 303 protected: | 303 protected: |
| 304 // Overridden from WindowImpl: | 304 // Overridden from WindowImpl: |
| 305 virtual HICON GetDefaultWindowIcon() const; | 305 virtual HICON GetDefaultWindowIcon() const; |
| 306 virtual void OnFinalMessage(HWND window); |
| 306 virtual LRESULT OnWndProc(UINT message, WPARAM w_param, LPARAM l_param); | 307 virtual LRESULT OnWndProc(UINT message, WPARAM w_param, LPARAM l_param); |
| 307 | 308 |
| 308 // Message Handlers | 309 // Message Handlers |
| 309 // These are all virtual so that specialized Widgets can modify or augment | 310 // These are all virtual so that specialized Widgets can modify or augment |
| 310 // processing. | 311 // processing. |
| 311 // This list is in _ALPHABETICAL_ order! | 312 // This list is in _ALPHABETICAL_ order! |
| 312 // Note: in the base class these functions must do nothing but convert point | 313 // Note: in the base class these functions must do nothing but convert point |
| 313 // coordinates to client coordinates (if necessary) and forward the | 314 // coordinates to client coordinates (if necessary) and forward the |
| 314 // handling to the appropriate Process* function. This is so that | 315 // handling to the appropriate Process* function. This is so that |
| 315 // subclasses can easily override these methods to do different things | 316 // subclasses can easily override these methods to do different things |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 367 virtual void OnMButtonDblClk(UINT flags, const CPoint& point); | 368 virtual void OnMButtonDblClk(UINT flags, const CPoint& point); |
| 368 virtual void OnMButtonDown(UINT flags, const CPoint& point); | 369 virtual void OnMButtonDown(UINT flags, const CPoint& point); |
| 369 virtual void OnMButtonUp(UINT flags, const CPoint& point); | 370 virtual void OnMButtonUp(UINT flags, const CPoint& point); |
| 370 virtual LRESULT OnMouseActivate(HWND window, UINT hittest_code, UINT message); | 371 virtual LRESULT OnMouseActivate(HWND window, UINT hittest_code, UINT message); |
| 371 virtual void OnMouseMove(UINT flags, const CPoint& point); | 372 virtual void OnMouseMove(UINT flags, const CPoint& point); |
| 372 virtual LRESULT OnMouseLeave(UINT message, WPARAM w_param, LPARAM l_param); | 373 virtual LRESULT OnMouseLeave(UINT message, WPARAM w_param, LPARAM l_param); |
| 373 virtual LRESULT OnMouseWheel(UINT message, WPARAM w_param, LPARAM l_param); | 374 virtual LRESULT OnMouseWheel(UINT message, WPARAM w_param, LPARAM l_param); |
| 374 virtual void OnMove(const CPoint& point) { SetMsgHandled(FALSE); } | 375 virtual void OnMove(const CPoint& point) { SetMsgHandled(FALSE); } |
| 375 virtual void OnMoving(UINT param, const LPRECT new_bounds) { } | 376 virtual void OnMoving(UINT param, const LPRECT new_bounds) { } |
| 376 virtual LRESULT OnMouseRange(UINT msg, WPARAM w_param, LPARAM l_param); | 377 virtual LRESULT OnMouseRange(UINT msg, WPARAM w_param, LPARAM l_param); |
| 377 virtual LRESULT OnNCActivate(BOOL active) { SetMsgHandled(FALSE); return 0; } | 378 virtual LRESULT OnNCActivate(BOOL active) { |
| 379 SetMsgHandled(FALSE); |
| 380 return 0; |
| 381 } |
| 378 virtual LRESULT OnNCCalcSize(BOOL w_param, LPARAM l_param) { | 382 virtual LRESULT OnNCCalcSize(BOOL w_param, LPARAM l_param) { |
| 379 SetMsgHandled(FALSE); | 383 SetMsgHandled(FALSE); |
| 380 return 0; | 384 return 0; |
| 381 } | 385 } |
| 382 virtual LRESULT OnNCHitTest(const CPoint& pt) { | 386 virtual LRESULT OnNCHitTest(const CPoint& pt) { |
| 383 SetMsgHandled(FALSE); | 387 SetMsgHandled(FALSE); |
| 384 return 0; | 388 return 0; |
| 385 } | 389 } |
| 386 virtual void OnNCLButtonDblClk(UINT flags, const CPoint& point); | 390 virtual void OnNCLButtonDblClk(UINT flags, const CPoint& point); |
| 387 virtual void OnNCLButtonDown(UINT flags, const CPoint& point); | 391 virtual void OnNCLButtonDown(UINT flags, const CPoint& point); |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 441 virtual void OnVScroll(int scroll_type, short position, HWND scrollbar) { | 445 virtual void OnVScroll(int scroll_type, short position, HWND scrollbar) { |
| 442 SetMsgHandled(FALSE); | 446 SetMsgHandled(FALSE); |
| 443 } | 447 } |
| 444 virtual void OnWindowPosChanging(WINDOWPOS* window_pos) { | 448 virtual void OnWindowPosChanging(WINDOWPOS* window_pos) { |
| 445 SetMsgHandled(FALSE); | 449 SetMsgHandled(FALSE); |
| 446 } | 450 } |
| 447 virtual void OnWindowPosChanged(WINDOWPOS* window_pos) { | 451 virtual void OnWindowPosChanged(WINDOWPOS* window_pos) { |
| 448 SetMsgHandled(FALSE); | 452 SetMsgHandled(FALSE); |
| 449 } | 453 } |
| 450 | 454 |
| 451 // deletes this window as it is destroyed, override to provide different | |
| 452 // behavior. | |
| 453 virtual void OnFinalMessage(HWND window); | |
| 454 | |
| 455 // Start tracking all mouse events so that this window gets sent mouse leave | 455 // Start tracking all mouse events so that this window gets sent mouse leave |
| 456 // messages too. |is_nonclient| is true when we should track WM_NCMOUSELEAVE | 456 // messages too. |is_nonclient| is true when we should track WM_NCMOUSELEAVE |
| 457 // messages instead of WM_MOUSELEAVE ones. | 457 // messages instead of WM_MOUSELEAVE ones. |
| 458 void TrackMouseEvents(DWORD mouse_tracking_flags); | 458 void TrackMouseEvents(DWORD mouse_tracking_flags); |
| 459 | 459 |
| 460 // Actually handle mouse events. These functions are called by subclasses who | 460 // Actually handle mouse events. These functions are called by subclasses who |
| 461 // override the message handlers above to do the actual real work of handling | 461 // override the message handlers above to do the actual real work of handling |
| 462 // the event in the View system. | 462 // the event in the View system. |
| 463 bool ProcessMousePressed(const CPoint& point, | 463 bool ProcessMousePressed(const CPoint& point, |
| 464 UINT flags, | 464 UINT flags, |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 588 | 588 |
| 589 // Instance of accessibility information and handling for MSAA root | 589 // Instance of accessibility information and handling for MSAA root |
| 590 CComPtr<IAccessible> accessibility_root_; | 590 CComPtr<IAccessible> accessibility_root_; |
| 591 | 591 |
| 592 scoped_ptr<DefaultThemeProvider> default_theme_provider_; | 592 scoped_ptr<DefaultThemeProvider> default_theme_provider_; |
| 593 }; | 593 }; |
| 594 | 594 |
| 595 } // namespace views | 595 } // namespace views |
| 596 | 596 |
| 597 #endif // VIEWS_WIDGET_WIDGET_WIN_H_ | 597 #endif // VIEWS_WIDGET_WIDGET_WIN_H_ |
| OLD | NEW |