| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "views/widget/native_widget_win.h" | 5 #include "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 "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 615 | 615 |
| 616 void NativeWidgetWin::ReleaseMouseCapture() { | 616 void NativeWidgetWin::ReleaseMouseCapture() { |
| 617 ReleaseCapture(); | 617 ReleaseCapture(); |
| 618 } | 618 } |
| 619 | 619 |
| 620 bool NativeWidgetWin::HasMouseCapture() const { | 620 bool NativeWidgetWin::HasMouseCapture() const { |
| 621 return GetCapture() == hwnd(); | 621 return GetCapture() == hwnd(); |
| 622 } | 622 } |
| 623 | 623 |
| 624 InputMethod* NativeWidgetWin::CreateInputMethod() { | 624 InputMethod* NativeWidgetWin::CreateInputMethod() { |
| 625 return views::Widget::IsPureViews() ? new InputMethodWin(this) : NULL; | 625 if (views::Widget::IsPureViews()) { |
| 626 InputMethod* input_method = new InputMethodWin(this); |
| 627 input_method->Init(GetWidget()); |
| 628 return input_method; |
| 629 } |
| 630 return NULL; |
| 626 } | 631 } |
| 627 | 632 |
| 628 void NativeWidgetWin::CenterWindow(const gfx::Size& size) { | 633 void NativeWidgetWin::CenterWindow(const gfx::Size& size) { |
| 629 HWND parent = GetParent(); | 634 HWND parent = GetParent(); |
| 630 if (!IsWindow()) | 635 if (!IsWindow()) |
| 631 parent = ::GetWindow(GetNativeView(), GW_OWNER); | 636 parent = ::GetWindow(GetNativeView(), GW_OWNER); |
| 632 ui::CenterAndSizeWindow(parent, GetNativeView(), size, false); | 637 ui::CenterAndSizeWindow(parent, GetNativeView(), size, false); |
| 633 } | 638 } |
| 634 | 639 |
| 635 void NativeWidgetWin::GetWindowBoundsAndMaximizedState(gfx::Rect* bounds, | 640 void NativeWidgetWin::GetWindowBoundsAndMaximizedState(gfx::Rect* bounds, |
| (...skipping 1889 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2525 return (GetKeyState(VK_LBUTTON) & 0x80) || | 2530 return (GetKeyState(VK_LBUTTON) & 0x80) || |
| 2526 (GetKeyState(VK_RBUTTON) & 0x80) || | 2531 (GetKeyState(VK_RBUTTON) & 0x80) || |
| 2527 (GetKeyState(VK_MBUTTON) & 0x80) || | 2532 (GetKeyState(VK_MBUTTON) & 0x80) || |
| 2528 (GetKeyState(VK_XBUTTON1) & 0x80) || | 2533 (GetKeyState(VK_XBUTTON1) & 0x80) || |
| 2529 (GetKeyState(VK_XBUTTON2) & 0x80); | 2534 (GetKeyState(VK_XBUTTON2) & 0x80); |
| 2530 } | 2535 } |
| 2531 | 2536 |
| 2532 } // namespace internal | 2537 } // namespace internal |
| 2533 | 2538 |
| 2534 } // namespace views | 2539 } // namespace views |
| OLD | NEW |