OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 UI_VIEWS_WIDGET_NATIVE_WIDGET_WIN_H_ | 5 #ifndef UI_VIEWS_WIDGET_NATIVE_WIDGET_WIN_H_ |
6 #define UI_VIEWS_WIDGET_NATIVE_WIDGET_WIN_H_ | 6 #define UI_VIEWS_WIDGET_NATIVE_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 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
486 typedef ScopedVector<ui::ViewProp> ViewProps; | 486 typedef ScopedVector<ui::ViewProp> ViewProps; |
487 typedef std::set<DWORD> TouchIDs; | 487 typedef std::set<DWORD> TouchIDs; |
488 | 488 |
489 // TODO(beng): This friendship can be removed once all methods relating to | 489 // TODO(beng): This friendship can be removed once all methods relating to |
490 // this object being a WindowImpl are moved to HWNDMessageHandler. | 490 // this object being a WindowImpl are moved to HWNDMessageHandler. |
491 friend HWNDMessageHandler; | 491 friend HWNDMessageHandler; |
492 | 492 |
493 // Overridden from HWNDMessageHandlerDelegate: | 493 // Overridden from HWNDMessageHandlerDelegate: |
494 virtual bool IsWidgetWindow() const OVERRIDE; | 494 virtual bool IsWidgetWindow() const OVERRIDE; |
495 virtual bool IsUsingCustomFrame() const OVERRIDE; | 495 virtual bool IsUsingCustomFrame() const OVERRIDE; |
496 virtual bool CanResize() const OVERRIDE; | |
497 virtual bool CanMaximize() const OVERRIDE; | |
498 virtual bool CanActivate() const OVERRIDE; | |
499 virtual int GetNonClientComponent(const gfx::Point& point) const OVERRIDE; | |
500 virtual void GetWindowMask(const gfx::Size& size, gfx::Path* path) OVERRIDE; | |
501 virtual InputMethod* GetInputMethod() OVERRIDE; | |
502 virtual void HandleAppDeactivated() OVERRIDE; | 496 virtual void HandleAppDeactivated() OVERRIDE; |
503 virtual bool HandleAppCommand(short command) OVERRIDE; | 497 virtual bool HandleAppCommand(short command) OVERRIDE; |
504 virtual void HandleCaptureLost() OVERRIDE; | 498 virtual void HandleCaptureLost() OVERRIDE; |
505 virtual void HandleClose() OVERRIDE; | 499 virtual void HandleClose() OVERRIDE; |
506 virtual bool HandleCommand(int command) OVERRIDE; | 500 virtual bool HandleCommand(int command) OVERRIDE; |
507 virtual void HandleDestroy() OVERRIDE; | 501 virtual void HandleDestroy() OVERRIDE; |
508 virtual void HandleDisplayChange() OVERRIDE; | 502 virtual void HandleDisplayChange() OVERRIDE; |
509 virtual void HandleGlassModeChange() OVERRIDE; | 503 virtual void HandleGlassModeChange() OVERRIDE; |
510 virtual void HandleBeginWMSizeMove() OVERRIDE; | 504 virtual void HandleBeginWMSizeMove() OVERRIDE; |
511 virtual void HandleEndWMSizeMove() OVERRIDE; | 505 virtual void HandleEndWMSizeMove() OVERRIDE; |
512 virtual void HandleMove() OVERRIDE; | |
513 virtual void HandleNativeFocus(HWND last_focused_window) OVERRIDE; | |
514 virtual void HandleNativeBlur(HWND focused_window) OVERRIDE; | |
515 virtual NativeWidgetWin* AsNativeWidgetWin() OVERRIDE; | 506 virtual NativeWidgetWin* AsNativeWidgetWin() OVERRIDE; |
516 | 507 |
517 // Called after the WM_ACTIVATE message has been processed by the default | 508 // Called after the WM_ACTIVATE message has been processed by the default |
518 // windows procedure. | 509 // windows procedure. |
519 static void PostProcessActivateMessage(NativeWidgetWin* widget, | 510 static void PostProcessActivateMessage(NativeWidgetWin* widget, |
520 int activation_state); | 511 int activation_state); |
521 | 512 |
522 void SetInitParams(const Widget::InitParams& params); | 513 void SetInitParams(const Widget::InitParams& params); |
523 | 514 |
524 // Synchronously paints the invalid contents of the Widget. | 515 // Synchronously paints the invalid contents of the Widget. |
525 void RedrawInvalidRect(); | 516 void RedrawInvalidRect(); |
526 | 517 |
527 // Synchronously updates the invalid contents of the Widget. Valid for | 518 // Synchronously updates the invalid contents of the Widget. Valid for |
528 // layered windows only. | 519 // layered windows only. |
529 void RedrawLayeredWindowContents(); | 520 void RedrawLayeredWindowContents(); |
530 | 521 |
531 // Lock or unlock the window from being able to redraw itself in response to | 522 // Lock or unlock the window from being able to redraw itself in response to |
532 // updates to its invalid region. | 523 // updates to its invalid region. |
533 class ScopedRedrawLock; | 524 class ScopedRedrawLock; |
534 void LockUpdates(bool force); | 525 void LockUpdates(bool force); |
535 void UnlockUpdates(bool force); | 526 void UnlockUpdates(bool force); |
536 | 527 |
537 // Determines whether the delegate expects the client size or the window size. | 528 // Determines whether the delegate expects the client size or the window size. |
538 bool WidgetSizeIsClientSize() const; | 529 bool WidgetSizeIsClientSize() const; |
539 | 530 |
540 // Responds to the client area changing size, either at window creation time | 531 // Responds to the client area changing size, either at window creation time |
541 // or subsequently. | 532 // or subsequently. |
542 void ClientAreaSizeChanged(); | 533 void ClientAreaSizeChanged(); |
543 | 534 |
| 535 // Resets the window region for the current widget bounds if necessary. |
| 536 // If |force| is true, the window region is reset to NULL even for native |
| 537 // frame windows. |
| 538 void ResetWindowRegion(bool force); |
| 539 |
544 // When removing the standard frame, tells the DWM how much glass we want on | 540 // When removing the standard frame, tells the DWM how much glass we want on |
545 // the edges. Currently hardcoded to 10px on all sides. | 541 // the edges. Currently hardcoded to 10px on all sides. |
546 void UpdateDWMFrame(); | 542 void UpdateDWMFrame(); |
547 | 543 |
548 // Calls DefWindowProc, safely wrapping the call in a ScopedRedrawLock to | 544 // Calls DefWindowProc, safely wrapping the call in a ScopedRedrawLock to |
549 // prevent frame flicker. DefWindowProc handling can otherwise render the | 545 // prevent frame flicker. DefWindowProc handling can otherwise render the |
550 // classic-look window title bar directly. | 546 // classic-look window title bar directly. |
551 LRESULT DefWindowProcWithRedrawLock(UINT message, | 547 LRESULT DefWindowProcWithRedrawLock(UINT message, |
552 WPARAM w_param, | 548 WPARAM w_param, |
553 LPARAM l_param); | 549 LPARAM l_param); |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
707 TouchIDs touch_ids_; | 703 TouchIDs touch_ids_; |
708 | 704 |
709 scoped_ptr<HWNDMessageHandler> message_handler_; | 705 scoped_ptr<HWNDMessageHandler> message_handler_; |
710 | 706 |
711 DISALLOW_COPY_AND_ASSIGN(NativeWidgetWin); | 707 DISALLOW_COPY_AND_ASSIGN(NativeWidgetWin); |
712 }; | 708 }; |
713 | 709 |
714 } // namespace views | 710 } // namespace views |
715 | 711 |
716 #endif // UI_VIEWS_WIDGET_NATIVE_WIDGET_WIN_H_ | 712 #endif // UI_VIEWS_WIDGET_NATIVE_WIDGET_WIN_H_ |
OLD | NEW |