Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(242)

Side by Side Diff: views/window/window_win.h

Issue 577018: Support app menu and double-click close on upper left corner of window, part ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 10 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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_WINDOW_WINDOW_WIN_H_ 5 #ifndef VIEWS_WINDOW_WINDOW_WIN_H_
6 #define VIEWS_WINDOW_WINDOW_WIN_H_ 6 #define VIEWS_WINDOW_WINDOW_WIN_H_
7 7
8 #include "views/widget/widget_win.h" 8 #include "views/widget/widget_win.h"
9 #include "views/window/window.h" 9 #include "views/window/window.h"
10 10
11 namespace gfx { 11 namespace gfx {
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 virtual void Init(HWND parent, const gfx::Rect& bounds); 101 virtual void Init(HWND parent, const gfx::Rect& bounds);
102 102
103 // Sizes the window to the default size specified by its ClientView. 103 // Sizes the window to the default size specified by its ClientView.
104 virtual void SizeWindowToDefault(); 104 virtual void SizeWindowToDefault();
105 105
106 // Returns the insets of the client area relative to the non-client area of 106 // Returns the insets of the client area relative to the non-client area of
107 // the window. Override this function instead of OnNCCalcSize, which is 107 // the window. Override this function instead of OnNCCalcSize, which is
108 // crazily complicated. 108 // crazily complicated.
109 virtual gfx::Insets GetClientAreaInsets() const; 109 virtual gfx::Insets GetClientAreaInsets() const;
110 110
111 // Shows the system menu at the specified screen point.
112 void RunSystemMenu(const gfx::Point& point);
113
114 // Overridden from WidgetWin: 111 // Overridden from WidgetWin:
115 virtual void OnActivate(UINT action, BOOL minimized, HWND window); 112 virtual void OnActivate(UINT action, BOOL minimized, HWND window);
116 virtual void OnActivateApp(BOOL active, DWORD thread_id); 113 virtual void OnActivateApp(BOOL active, DWORD thread_id);
117 virtual LRESULT OnAppCommand(HWND window, short app_command, WORD device, 114 virtual LRESULT OnAppCommand(HWND window, short app_command, WORD device,
118 int keystate); 115 int keystate);
119 virtual void OnCommand(UINT notification_code, int command_id, HWND window); 116 virtual void OnCommand(UINT notification_code, int command_id, HWND window);
120 virtual void OnDestroy(); 117 virtual void OnDestroy();
121 virtual LRESULT OnDwmCompositionChanged(UINT msg, WPARAM w_param, 118 virtual LRESULT OnDwmCompositionChanged(UINT msg, WPARAM w_param,
122 LPARAM l_param); 119 LPARAM l_param);
123 virtual void OnFinalMessage(HWND window); 120 virtual void OnFinalMessage(HWND window);
124 virtual void OnGetMinMaxInfo(MINMAXINFO* minmax_info); 121 virtual void OnGetMinMaxInfo(MINMAXINFO* minmax_info);
125 virtual void OnInitMenu(HMENU menu); 122 virtual void OnInitMenu(HMENU menu);
126 virtual void OnMouseLeave(); 123 virtual void OnMouseLeave();
127 virtual LRESULT OnNCActivate(BOOL active); 124 virtual LRESULT OnNCActivate(BOOL active);
128 LRESULT OnNCCalcSize(BOOL mode, LPARAM l_param); // Don't override. 125 LRESULT OnNCCalcSize(BOOL mode, LPARAM l_param); // Don't override.
129 virtual LRESULT OnNCHitTest(const CPoint& point); 126 virtual LRESULT OnNCHitTest(const CPoint& point);
130 virtual void OnNCPaint(HRGN rgn); 127 virtual void OnNCPaint(HRGN rgn);
131 virtual void OnNCLButtonDown(UINT ht_component, const CPoint& point); 128 virtual void OnNCLButtonDown(UINT ht_component, const CPoint& point);
132 virtual void OnNCLButtonUp(UINT ht_component, const CPoint& point);
133 virtual void OnNCRButtonDown(UINT ht_component, const CPoint& point); 129 virtual void OnNCRButtonDown(UINT ht_component, const CPoint& point);
134 virtual void OnNCRButtonUp(UINT ht_component, const CPoint& point);
135 virtual void OnRButtonUp(UINT ht_component, const CPoint& point); 130 virtual void OnRButtonUp(UINT ht_component, const CPoint& point);
136 virtual LRESULT OnNCUAHDrawCaption(UINT msg, WPARAM w_param, LPARAM l_param); 131 virtual LRESULT OnNCUAHDrawCaption(UINT msg, WPARAM w_param, LPARAM l_param);
137 virtual LRESULT OnNCUAHDrawFrame(UINT msg, WPARAM w_param, LPARAM l_param); 132 virtual LRESULT OnNCUAHDrawFrame(UINT msg, WPARAM w_param, LPARAM l_param);
138 virtual LRESULT OnSetIcon(UINT size_type, HICON new_icon); 133 virtual LRESULT OnSetIcon(UINT size_type, HICON new_icon);
139 virtual LRESULT OnSetText(const wchar_t* text); 134 virtual LRESULT OnSetText(const wchar_t* text);
140 virtual void OnSettingChange(UINT flags, const wchar_t* section); 135 virtual void OnSettingChange(UINT flags, const wchar_t* section);
141 virtual void OnSize(UINT size_param, const CSize& new_size); 136 virtual void OnSize(UINT size_param, const CSize& new_size);
142 virtual void OnSysCommand(UINT notification_code, CPoint click); 137 virtual void OnSysCommand(UINT notification_code, CPoint click);
143 virtual void OnWindowPosChanging(WINDOWPOS* window_pos); 138 virtual void OnWindowPosChanging(WINDOWPOS* window_pos);
144 virtual Window* GetWindow() { return this; } 139 virtual Window* GetWindow() { return this; }
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 // If this is greater than zero, we should prevent attempts to make the window 282 // If this is greater than zero, we should prevent attempts to make the window
288 // visible when we handle WM_WINDOWPOSCHANGING. Some calls like 283 // visible when we handle WM_WINDOWPOSCHANGING. Some calls like
289 // ShowWindow(SW_RESTORE) make the window visible in addition to restoring it, 284 // ShowWindow(SW_RESTORE) make the window visible in addition to restoring it,
290 // when all we want to do is restore it. 285 // when all we want to do is restore it.
291 int force_hidden_count_; 286 int force_hidden_count_;
292 287
293 // Set to true when the user presses the right mouse button on the caption 288 // Set to true when the user presses the right mouse button on the caption
294 // area. We need this so we can correctly show the context menu on mouse-up. 289 // area. We need this so we can correctly show the context menu on mouse-up.
295 bool is_right_mouse_pressed_on_caption_; 290 bool is_right_mouse_pressed_on_caption_;
296 291
297 // With our current behavior when we track popup menu we capture the mouse
298 // so doubleclick does not work. If user doubleclicks on the system icon
299 // the menu will be canceled and user will receive WM_NCLBUTTONUP.
300 // So we store the last time system menu was opened and canceled
301 DWORD last_time_system_menu_clicked_;
302
303 // The last-seen monitor containing us, and its rect and work area. These are 292 // The last-seen monitor containing us, and its rect and work area. These are
304 // used to catch updates to the rect and work area and react accordingly. 293 // used to catch updates to the rect and work area and react accordingly.
305 HMONITOR last_monitor_; 294 HMONITOR last_monitor_;
306 gfx::Rect last_monitor_rect_, last_work_area_; 295 gfx::Rect last_monitor_rect_, last_work_area_;
307 296
308 // The window styles before we modified them for the drag frame appearance. 297 // The window styles before we modified them for the drag frame appearance.
309 DWORD drag_frame_saved_window_style_; 298 DWORD drag_frame_saved_window_style_;
310 DWORD drag_frame_saved_window_ex_style_; 299 DWORD drag_frame_saved_window_ex_style_;
311 300
312 DISALLOW_COPY_AND_ASSIGN(WindowWin); 301 DISALLOW_COPY_AND_ASSIGN(WindowWin);
313 }; 302 };
314 303
315 } // namespace views 304 } // namespace views
316 305
317 #endif // VIEWS_WINDOW_WINDOW_WIN_H_ 306 #endif // VIEWS_WINDOW_WINDOW_WIN_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698