| 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 <atlcrack.h> | 10 #include <atlcrack.h> |
| 11 #include <atlmisc.h> |
| 10 | 12 |
| 11 #include "base/message_loop.h" | 13 #include "base/message_loop.h" |
| 12 #include "base/system_monitor.h" | 14 #include "base/system_monitor.h" |
| 13 #include "views/focus/focus_manager.h" | 15 #include "views/focus/focus_manager.h" |
| 14 #include "views/layout_manager.h" | 16 #include "views/layout_manager.h" |
| 15 #include "views/widget/widget.h" | 17 #include "views/widget/widget.h" |
| 16 | 18 |
| 17 class ChromeCanvas; | 19 class ChromeCanvas; |
| 18 | 20 |
| 19 namespace gfx { | 21 namespace gfx { |
| 20 class Rect; | 22 class Rect; |
| 21 } | 23 } |
| 22 | 24 |
| 23 namespace views { | 25 namespace views { |
| 24 | 26 |
| 25 class RootView; | 27 class RootView; |
| 26 class TooltipManager; | 28 class TooltipManager; |
| 27 class DefaultThemeProvider; | 29 class DefaultThemeProvider; |
| 28 class Window; | 30 class Window; |
| 29 | 31 |
| 30 bool SetRootViewForHWND(HWND hwnd, RootView* root_view); | 32 bool SetRootViewForHWND(HWND hwnd, RootView* root_view); |
| 31 RootView* GetRootViewForHWND(HWND hwnd); | 33 RootView* GetRootViewForHWND(HWND hwnd); |
| 32 | 34 |
| 33 // A Windows message reflected from other windows. This message is sent | 35 // A Windows message reflected from other windows. This message is sent |
| 34 // with the following arguments: | 36 // with the following arguments: |
| 35 // hWnd - Target window | 37 // hWnd - Target window |
| 36 // uMsg - kReflectedMessage | 38 // uMsg - kReflectedMessage |
| 37 // wParam - Should be 0 | 39 // wParam - Should be 0 |
| 38 // lParam - Pointer to MSG struct containing the original message. | 40 // lParam - Pointer to MSG struct containing the original message. |
| 39 static const int kReflectedMessage = WM_APP + 3; | 41 const int kReflectedMessage = WM_APP + 3; |
| 40 | 42 |
| 41 // These two messages aren't defined in winuser.h, but they are sent to windows | 43 // These two messages aren't defined in winuser.h, but they are sent to windows |
| 42 // with captions. They appear to paint the window caption and frame. | 44 // with captions. They appear to paint the window caption and frame. |
| 43 // Unfortunately if you override the standard non-client rendering as we do | 45 // Unfortunately if you override the standard non-client rendering as we do |
| 44 // with CustomFrameWindow, sometimes Windows (not deterministically | 46 // with CustomFrameWindow, sometimes Windows (not deterministically |
| 45 // reproducibly but definitely frequently) will send these messages to the | 47 // reproducibly but definitely frequently) will send these messages to the |
| 46 // window and paint the standard caption/title over the top of the custom one. | 48 // window and paint the standard caption/title over the top of the custom one. |
| 47 // So we need to handle these messages in CustomFrameWindow to prevent this | 49 // So we need to handle these messages in CustomFrameWindow to prevent this |
| 48 // from happening. | 50 // from happening. |
| 49 static const int WM_NCUAHDRAWCAPTION = 0xAE; | 51 const int WM_NCUAHDRAWCAPTION = 0xAE; |
| 50 static const int WM_NCUAHDRAWFRAME = 0xAF; | 52 const int WM_NCUAHDRAWFRAME = 0xAF; |
| 51 | 53 |
| 52 /////////////////////////////////////////////////////////////////////////////// | 54 /////////////////////////////////////////////////////////////////////////////// |
| 53 // | 55 // |
| 54 // WidgetWin | 56 // WidgetWin |
| 55 // A Widget for a views hierarchy used to represent anything that can be | 57 // A Widget for a views hierarchy used to represent anything that can be |
| 56 // contained within an HWND, e.g. a control, a window, etc. Specializations | 58 // contained within an HWND, e.g. a control, a window, etc. Specializations |
| 57 // suitable for specific tasks, e.g. top level window, are derived from this. | 59 // suitable for specific tasks, e.g. top level window, are derived from this. |
| 58 // | 60 // |
| 59 // This Widget contains a RootView which owns the hierarchy of views within it. | 61 // This Widget contains a RootView which owns the hierarchy of views within it. |
| 60 // As long as views are part of this tree, they will be deleted automatically | 62 // As long as views are part of this tree, they will be deleted automatically |
| (...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 632 | 634 |
| 633 scoped_ptr<DefaultThemeProvider> default_theme_provider_; | 635 scoped_ptr<DefaultThemeProvider> default_theme_provider_; |
| 634 | 636 |
| 635 // Our hwnd. | 637 // Our hwnd. |
| 636 HWND hwnd_; | 638 HWND hwnd_; |
| 637 }; | 639 }; |
| 638 | 640 |
| 639 } // namespace views | 641 } // namespace views |
| 640 | 642 |
| 641 #endif // #ifndef VIEWS_WIDGET_WIDGET_WIN_H_ | 643 #endif // #ifndef VIEWS_WIDGET_WIDGET_WIN_H_ |
| OLD | NEW |