OLD | NEW |
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 642 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
653 ::ReleaseCapture(); | 653 ::ReleaseCapture(); |
654 } | 654 } |
655 | 655 |
656 bool NativeWidgetWin::HasCapture(unsigned int flags) const { | 656 bool NativeWidgetWin::HasCapture(unsigned int flags) const { |
657 if (flags == ui::CW_LOCK_MOUSE) | 657 if (flags == ui::CW_LOCK_MOUSE) |
658 return ::GetCapture() == hwnd(); | 658 return ::GetCapture() == hwnd(); |
659 return false; | 659 return false; |
660 } | 660 } |
661 | 661 |
662 InputMethod* NativeWidgetWin::CreateInputMethod() { | 662 InputMethod* NativeWidgetWin::CreateInputMethod() { |
663 if (views::Widget::IsPureViews()) { | 663 #if defined(USE_AURA) |
664 InputMethod* input_method = new InputMethodWin(this); | 664 InputMethod* input_method = new InputMethodWin(this); |
665 input_method->Init(GetWidget()); | 665 input_method->Init(GetWidget()); |
666 return input_method; | 666 return input_method; |
667 } | 667 #else |
668 return NULL; | 668 return NULL; |
| 669 #endif |
669 } | 670 } |
670 | 671 |
671 void NativeWidgetWin::CenterWindow(const gfx::Size& size) { | 672 void NativeWidgetWin::CenterWindow(const gfx::Size& size) { |
672 HWND parent = GetParent(); | 673 HWND parent = GetParent(); |
673 if (!IsWindow()) | 674 if (!IsWindow()) |
674 parent = ::GetWindow(GetNativeView(), GW_OWNER); | 675 parent = ::GetWindow(GetNativeView(), GW_OWNER); |
675 ui::CenterAndSizeWindow(parent, GetNativeView(), size); | 676 ui::CenterAndSizeWindow(parent, GetNativeView(), size); |
676 } | 677 } |
677 | 678 |
678 void NativeWidgetWin::GetWindowPlacement( | 679 void NativeWidgetWin::GetWindowPlacement( |
(...skipping 1968 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2647 return (GetKeyState(VK_LBUTTON) & 0x80) || | 2648 return (GetKeyState(VK_LBUTTON) & 0x80) || |
2648 (GetKeyState(VK_RBUTTON) & 0x80) || | 2649 (GetKeyState(VK_RBUTTON) & 0x80) || |
2649 (GetKeyState(VK_MBUTTON) & 0x80) || | 2650 (GetKeyState(VK_MBUTTON) & 0x80) || |
2650 (GetKeyState(VK_XBUTTON1) & 0x80) || | 2651 (GetKeyState(VK_XBUTTON1) & 0x80) || |
2651 (GetKeyState(VK_XBUTTON2) & 0x80); | 2652 (GetKeyState(VK_XBUTTON2) & 0x80); |
2652 } | 2653 } |
2653 | 2654 |
2654 } // namespace internal | 2655 } // namespace internal |
2655 | 2656 |
2656 } // namespace views | 2657 } // namespace views |
OLD | NEW |