summaryrefslogtreecommitdiffstats
path: root/chrome/views/widget_win.h
diff options
context:
space:
mode:
authorben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-03 00:28:00 +0000
committerben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-03 00:28:00 +0000
commit32670b07a6c42634f446e3d471f42a9fb40090f2 (patch)
tree77b15435f3a436d54fcaa5cb4c0d4371a007fad6 /chrome/views/widget_win.h
parenta0e5688cc11f7f5e835b5c1a75c17ce4a28a1527 (diff)
downloadchromium_src-32670b07a6c42634f446e3d471f42a9fb40090f2.zip
chromium_src-32670b07a6c42634f446e3d471f42a9fb40090f2.tar.gz
chromium_src-32670b07a6c42634f446e3d471f42a9fb40090f2.tar.bz2
Support DWM switching.
This completes the collapsing of window types and browser frames around a single class: views::Window. CustomFrameWindow is removed with this change. The Browser window is represented by a single views::Window subclass: BrowserFrame, which replaces both AeroGlassFrame and OpaqueFrame. NonClientView is now a container of two sibling classes - the Window's ClientView (in the Browser's case, BrowserView), and a NonClientFrameView subclass, which provides the rendering for the non-client portions of the window. These Views are siblings rather than the ClientView a child of the NonClientFrameView because when the DWM is toggled, the ClientView would have to be re-parented. Many Views make the assumption they are only inserted into a View hierarchy once, and so this is problematic. By having the views be siblings, this is avoided. With this in mind, all of the former NonClientViews now become NonClientFrameView subclasses: DefaultNonClientView -> CustomFrameView (non-existent, NonClientView) -> NativeFrameView AeroGlassNonClientView -> GlassBrowserFrameView OpaqueNonClientView -> OpaqueBrowserFrameView The latter two derive from NonClientFrameView via BrowserNonClientFrameView, which adds some extras. I also had to modify the TabRenderer class to know how to drop its cache of tab background images when the theme changes since it uses different ones for Glass and non-Glass. This change also fixes a few non-client flicker issues relating to window non-client activation by using more ScopedRedrawLocks. (Touches info_bubble.cc, window.cc) Bugs fixed: http://crbug.com/153 http://crbug.com/747 http://crbug.com/2371 http://crbug.com/3264 http://crbug.com/8234 Plumbing for http://crbug.com/8247 Design docs: http://dev.chromium.org/developers/design-documents/views-windowing http://dev.chromium.org/developers/design-documents/browser-window Review URL: http://codereview.chromium.org/27317 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10757 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/views/widget_win.h')
-rw-r--r--chrome/views/widget_win.h19
1 files changed, 17 insertions, 2 deletions
diff --git a/chrome/views/widget_win.h b/chrome/views/widget_win.h
index 97f9fe4..546e9f7 100644
--- a/chrome/views/widget_win.h
+++ b/chrome/views/widget_win.h
@@ -176,6 +176,9 @@ class WidgetWin : public Widget,
MESSAGE_HANDLER_EX(WM_NCUAHDRAWCAPTION, OnNCUAHDrawCaption)
MESSAGE_HANDLER_EX(WM_NCUAHDRAWFRAME, OnNCUAHDrawFrame)
+ // Vista and newer
+ MESSAGE_HANDLER_EX(WM_DWMCOMPOSITIONCHANGED, OnDwmCompositionChanged)
+
// Non-atlcrack.h handlers
MESSAGE_HANDLER_EX(WM_GETOBJECT, OnGetObject)
MESSAGE_HANDLER_EX(WM_NCMOUSELEAVE, OnNCMouseLeave)
@@ -183,6 +186,7 @@ class WidgetWin : public Widget,
// This list is in _ALPHABETICAL_ order! OR I WILL HURT YOU.
MSG_WM_ACTIVATE(OnActivate)
+ MSG_WM_ACTIVATEAPP(OnActivateApp)
MSG_WM_APPCOMMAND(OnAppCommand)
MSG_WM_CANCELMODE(OnCancelMode)
MSG_WM_CAPTURECHANGED(OnCaptureChanged)
@@ -347,7 +351,12 @@ class WidgetWin : public Widget,
// handling to the appropriate Process* function. This is so that
// subclasses can easily override these methods to do different things
// and have a convenient function to call to get the default behavior.
- virtual void OnActivate(UINT action, BOOL minimized, HWND window) { }
+ virtual void OnActivate(UINT action, BOOL minimized, HWND window) {
+ SetMsgHandled(FALSE);
+ }
+ virtual void OnActivateApp(BOOL active, DWORD thread_id) {
+ SetMsgHandled(FALSE);
+ }
virtual LRESULT OnAppCommand(HWND window, short app_command, WORD device,
int keystate) {
SetMsgHandled(FALSE);
@@ -362,6 +371,12 @@ class WidgetWin : public Widget,
// WARNING: If you override this be sure and invoke super, otherwise we'll
// leak a few things.
virtual void OnDestroy();
+ virtual LRESULT OnDwmCompositionChanged(UINT msg,
+ WPARAM w_param,
+ LPARAM l_param) {
+ SetMsgHandled(FALSE);
+ return 0;
+ }
virtual void OnEndSession(BOOL ending, UINT logoff) { SetMsgHandled(FALSE); }
virtual void OnEnterSizeMove() { SetMsgHandled(FALSE); }
virtual void OnExitMenuLoop(BOOL is_track_popup_menu) { SetMsgHandled(FALSE); }
@@ -384,7 +399,7 @@ class WidgetWin : public Widget,
virtual void OnMButtonUp(UINT flags, const CPoint& point);
virtual LRESULT OnMouseActivate(HWND window, UINT hittest_code, UINT message);
virtual void OnMouseMove(UINT flags, const CPoint& point);
- virtual LRESULT OnMouseLeave(UINT uMsg, WPARAM w_param, LPARAM l_param);
+ virtual LRESULT OnMouseLeave(UINT message, WPARAM w_param, LPARAM l_param);
virtual void OnMove(const CPoint& point) { SetMsgHandled(FALSE); }
virtual void OnMoving(UINT param, const LPRECT new_bounds) { }
virtual LRESULT OnMouseWheel(UINT flags, short distance, const CPoint& point);