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

Side by Side Diff: ui/views/widget/native_widget_win.cc

Issue 10270002: Get the custom frame limping with win-aura. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 7 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
« no previous file with comments | « ui/views/widget/native_widget_helper_aura.h ('k') | ui/views/widget/widget_hwnd_utils.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "ui/views/widget/native_widget_win.h" 5 #include "ui/views/widget/native_widget_win.h"
6 6
7 #include <dwmapi.h> 7 #include <dwmapi.h>
8 #include <shellapi.h> 8 #include <shellapi.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 29 matching lines...) Expand all
40 #include "ui/views/focus/view_storage.h" 40 #include "ui/views/focus/view_storage.h"
41 #include "ui/views/ime/input_method_win.h" 41 #include "ui/views/ime/input_method_win.h"
42 #include "ui/views/views_delegate.h" 42 #include "ui/views/views_delegate.h"
43 #include "ui/views/widget/aero_tooltip_manager.h" 43 #include "ui/views/widget/aero_tooltip_manager.h"
44 #include "ui/views/widget/child_window_message_processor.h" 44 #include "ui/views/widget/child_window_message_processor.h"
45 #include "ui/views/widget/drop_target_win.h" 45 #include "ui/views/widget/drop_target_win.h"
46 #include "ui/views/widget/monitor_win.h" 46 #include "ui/views/widget/monitor_win.h"
47 #include "ui/views/widget/native_widget_delegate.h" 47 #include "ui/views/widget/native_widget_delegate.h"
48 #include "ui/views/widget/root_view.h" 48 #include "ui/views/widget/root_view.h"
49 #include "ui/views/widget/widget_delegate.h" 49 #include "ui/views/widget/widget_delegate.h"
50 #include "ui/views/widget/widget_hwnd_utils.h"
50 #include "ui/views/window/native_frame_view.h" 51 #include "ui/views/window/native_frame_view.h"
51 52
52 #pragma comment(lib, "dwmapi.lib") 53 #pragma comment(lib, "dwmapi.lib")
53 54
54 using ui::ViewProp; 55 using ui::ViewProp;
55 56
56 namespace views { 57 namespace views {
57 58
58 namespace { 59 namespace {
59 60
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 // child HWND beneath the original HWND. 218 // child HWND beneath the original HWND.
218 BOOL CALLBACK EnumerateChildWindowsForNativeWidgets(HWND hwnd, LPARAM l_param) { 219 BOOL CALLBACK EnumerateChildWindowsForNativeWidgets(HWND hwnd, LPARAM l_param) {
219 Widget* widget = Widget::GetWidgetForNativeView(hwnd); 220 Widget* widget = Widget::GetWidgetForNativeView(hwnd);
220 if (widget) { 221 if (widget) {
221 Widget::Widgets* widgets = reinterpret_cast<Widget::Widgets*>(l_param); 222 Widget::Widgets* widgets = reinterpret_cast<Widget::Widgets*>(l_param);
222 widgets->insert(widget); 223 widgets->insert(widget);
223 } 224 }
224 return TRUE; 225 return TRUE;
225 } 226 }
226 227
227 // Returns true if the WINDOWPOS data provided indicates the client area of
228 // the window may have changed size. This can be caused by the window being
229 // resized or its frame changing.
230 bool DidClientAreaSizeChange(const WINDOWPOS* window_pos) {
231 return !(window_pos->flags & SWP_NOSIZE) ||
232 window_pos->flags & SWP_FRAMECHANGED;
233 }
234
235 // Callback used to notify child windows that the top level window received a 228 // Callback used to notify child windows that the top level window received a
236 // DWMCompositionChanged message. 229 // DWMCompositionChanged message.
237 BOOL CALLBACK SendDwmCompositionChanged(HWND window, LPARAM param) { 230 BOOL CALLBACK SendDwmCompositionChanged(HWND window, LPARAM param) {
238 SendMessage(window, WM_DWMCOMPOSITIONCHANGED, 0, 0); 231 SendMessage(window, WM_DWMCOMPOSITIONCHANGED, 0, 0);
239 return TRUE; 232 return TRUE;
240 } 233 }
241 234
242 // Tells the window its frame (non-client area) has changed. 235 // Tells the window its frame (non-client area) has changed.
243 void SendFrameChanged(HWND window) { 236 void SendFrameChanged(HWND window) {
244 SetWindowPos(window, NULL, 0, 0, 0, 0, 237 SetWindowPos(window, NULL, 0, 0, 0, 0,
(...skipping 2428 matching lines...) Expand 10 before | Expand all | Expand 10 after
2673 return (GetKeyState(VK_LBUTTON) & 0x80) || 2666 return (GetKeyState(VK_LBUTTON) & 0x80) ||
2674 (GetKeyState(VK_RBUTTON) & 0x80) || 2667 (GetKeyState(VK_RBUTTON) & 0x80) ||
2675 (GetKeyState(VK_MBUTTON) & 0x80) || 2668 (GetKeyState(VK_MBUTTON) & 0x80) ||
2676 (GetKeyState(VK_XBUTTON1) & 0x80) || 2669 (GetKeyState(VK_XBUTTON1) & 0x80) ||
2677 (GetKeyState(VK_XBUTTON2) & 0x80); 2670 (GetKeyState(VK_XBUTTON2) & 0x80);
2678 } 2671 }
2679 2672
2680 } // namespace internal 2673 } // namespace internal
2681 2674
2682 } // namespace views 2675 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/widget/native_widget_helper_aura.h ('k') | ui/views/widget/widget_hwnd_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698