| 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 #include "ui/views/widget/aero_tooltip_manager.h" | 44 #include "ui/views/widget/aero_tooltip_manager.h" |
| 45 #include "ui/views/widget/child_window_message_processor.h" | 45 #include "ui/views/widget/child_window_message_processor.h" |
| 46 #include "ui/views/widget/drop_target_win.h" | 46 #include "ui/views/widget/drop_target_win.h" |
| 47 #include "ui/views/widget/monitor_win.h" | 47 #include "ui/views/widget/monitor_win.h" |
| 48 #include "ui/views/widget/native_widget_delegate.h" | 48 #include "ui/views/widget/native_widget_delegate.h" |
| 49 #include "ui/views/widget/root_view.h" | 49 #include "ui/views/widget/root_view.h" |
| 50 #include "ui/views/widget/widget_delegate.h" | 50 #include "ui/views/widget/widget_delegate.h" |
| 51 #include "ui/views/widget/widget_hwnd_utils.h" | 51 #include "ui/views/widget/widget_hwnd_utils.h" |
| 52 #include "ui/views/window/native_frame_view.h" | 52 #include "ui/views/window/native_frame_view.h" |
| 53 | 53 |
| 54 #if !defined(USE_AURA) |
| 55 #include "base/command_line.h" |
| 56 #include "ui/base/ui_base_switches.h" |
| 57 #endif |
| 58 |
| 54 #pragma comment(lib, "dwmapi.lib") | 59 #pragma comment(lib, "dwmapi.lib") |
| 55 | 60 |
| 56 // From msdn: | 61 // From msdn: |
| 57 #define MOUSEEVENTF_FROMTOUCH 0xFF515700 | 62 #define MOUSEEVENTF_FROMTOUCH 0xFF515700 |
| 58 | 63 |
| 59 using ui::ViewProp; | 64 using ui::ViewProp; |
| 60 | 65 |
| 61 namespace views { | 66 namespace views { |
| 62 | 67 |
| 63 namespace { | 68 namespace { |
| (...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 661 | 666 |
| 662 void NativeWidgetWin::ReleaseCapture() { | 667 void NativeWidgetWin::ReleaseCapture() { |
| 663 ::ReleaseCapture(); | 668 ::ReleaseCapture(); |
| 664 } | 669 } |
| 665 | 670 |
| 666 bool NativeWidgetWin::HasCapture() const { | 671 bool NativeWidgetWin::HasCapture() const { |
| 667 return ::GetCapture() == hwnd(); | 672 return ::GetCapture() == hwnd(); |
| 668 } | 673 } |
| 669 | 674 |
| 670 InputMethod* NativeWidgetWin::CreateInputMethod() { | 675 InputMethod* NativeWidgetWin::CreateInputMethod() { |
| 671 #if defined(USE_AURA) | 676 #if !defined(USE_AURA) |
| 677 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| 678 if (!command_line->HasSwitch(switches::kEnableViewsTextfield)) |
| 679 return NULL; |
| 680 #endif |
| 672 InputMethod* input_method = new InputMethodWin(this); | 681 InputMethod* input_method = new InputMethodWin(this); |
| 673 input_method->Init(GetWidget()); | 682 input_method->Init(GetWidget()); |
| 674 return input_method; | 683 return input_method; |
| 675 #else | |
| 676 return NULL; | |
| 677 #endif | |
| 678 } | 684 } |
| 679 | 685 |
| 680 void NativeWidgetWin::CenterWindow(const gfx::Size& size) { | 686 void NativeWidgetWin::CenterWindow(const gfx::Size& size) { |
| 681 HWND parent = GetParent(); | 687 HWND parent = GetParent(); |
| 682 if (!IsWindow()) | 688 if (!IsWindow()) |
| 683 parent = ::GetWindow(GetNativeView(), GW_OWNER); | 689 parent = ::GetWindow(GetNativeView(), GW_OWNER); |
| 684 ui::CenterAndSizeWindow(parent, GetNativeView(), size); | 690 ui::CenterAndSizeWindow(parent, GetNativeView(), size); |
| 685 } | 691 } |
| 686 | 692 |
| 687 void NativeWidgetWin::GetWindowPlacement( | 693 void NativeWidgetWin::GetWindowPlacement( |
| (...skipping 2038 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2726 // static | 2732 // static |
| 2727 bool NativeWidgetPrivate::IsTouchDown() { | 2733 bool NativeWidgetPrivate::IsTouchDown() { |
| 2728 // This currently isn't necessary because we're not generating touch events on | 2734 // This currently isn't necessary because we're not generating touch events on |
| 2729 // windows. When we do, this will need to be updated. | 2735 // windows. When we do, this will need to be updated. |
| 2730 return false; | 2736 return false; |
| 2731 } | 2737 } |
| 2732 | 2738 |
| 2733 } // namespace internal | 2739 } // namespace internal |
| 2734 | 2740 |
| 2735 } // namespace views | 2741 } // namespace views |
| OLD | NEW |