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

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

Issue 9351010: views / Windows: A child window should be centered with respect to its parent, not the monitor. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 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
« no previous file with comments | « ui/base/win/hwnd_util.cc ('k') | no next file » | 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 653 matching lines...) Expand 10 before | Expand all | Expand 10 after
664 input_method->Init(GetWidget()); 664 input_method->Init(GetWidget());
665 return input_method; 665 return input_method;
666 } 666 }
667 return NULL; 667 return NULL;
668 } 668 }
669 669
670 void NativeWidgetWin::CenterWindow(const gfx::Size& size) { 670 void NativeWidgetWin::CenterWindow(const gfx::Size& size) {
671 HWND parent = GetParent(); 671 HWND parent = GetParent();
672 if (!IsWindow()) 672 if (!IsWindow())
673 parent = ::GetWindow(GetNativeView(), GW_OWNER); 673 parent = ::GetWindow(GetNativeView(), GW_OWNER);
674 ui::CenterAndSizeWindow(parent, GetNativeView(), size, false); 674 ui::CenterAndSizeWindow(parent, GetNativeView(), size);
675 } 675 }
676 676
677 void NativeWidgetWin::GetWindowPlacement( 677 void NativeWidgetWin::GetWindowPlacement(
678 gfx::Rect* bounds, 678 gfx::Rect* bounds,
679 ui::WindowShowState* show_state) const { 679 ui::WindowShowState* show_state) const {
680 WINDOWPLACEMENT wp; 680 WINDOWPLACEMENT wp;
681 wp.length = sizeof(wp); 681 wp.length = sizeof(wp);
682 const bool succeeded = !!::GetWindowPlacement(GetNativeView(), &wp); 682 const bool succeeded = !!::GetWindowPlacement(GetNativeView(), &wp);
683 DCHECK(succeeded); 683 DCHECK(succeeded);
684 684
(...skipping 1923 matching lines...) Expand 10 before | Expand all | Expand 10 after
2608 return (GetKeyState(VK_LBUTTON) & 0x80) || 2608 return (GetKeyState(VK_LBUTTON) & 0x80) ||
2609 (GetKeyState(VK_RBUTTON) & 0x80) || 2609 (GetKeyState(VK_RBUTTON) & 0x80) ||
2610 (GetKeyState(VK_MBUTTON) & 0x80) || 2610 (GetKeyState(VK_MBUTTON) & 0x80) ||
2611 (GetKeyState(VK_XBUTTON1) & 0x80) || 2611 (GetKeyState(VK_XBUTTON1) & 0x80) ||
2612 (GetKeyState(VK_XBUTTON2) & 0x80); 2612 (GetKeyState(VK_XBUTTON2) & 0x80);
2613 } 2613 }
2614 2614
2615 } // namespace internal 2615 } // namespace internal
2616 2616
2617 } // namespace views 2617 } // namespace views
OLDNEW
« no previous file with comments | « ui/base/win/hwnd_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698