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 <algorithm> | 10 #include <algorithm> |
(...skipping 27 matching lines...) Expand all Loading... |
38 #include "ui/views/ime/input_method_win.h" | 38 #include "ui/views/ime/input_method_win.h" |
39 #include "ui/views/window/native_frame_view.h" | 39 #include "ui/views/window/native_frame_view.h" |
40 #include "views/controls/native_control_win.h" | 40 #include "views/controls/native_control_win.h" |
41 #include "views/controls/textfield/native_textfield_views.h" | 41 #include "views/controls/textfield/native_textfield_views.h" |
42 #include "views/views_delegate.h" | 42 #include "views/views_delegate.h" |
43 #include "views/widget/aero_tooltip_manager.h" | 43 #include "views/widget/aero_tooltip_manager.h" |
44 #include "views/widget/child_window_message_processor.h" | 44 #include "views/widget/child_window_message_processor.h" |
45 #include "views/widget/drop_target_win.h" | 45 #include "views/widget/drop_target_win.h" |
46 #include "views/widget/monitor_win.h" | 46 #include "views/widget/monitor_win.h" |
47 #include "views/widget/native_widget_delegate.h" | 47 #include "views/widget/native_widget_delegate.h" |
48 #include "views/widget/native_widget_views.h" | |
49 #include "views/widget/root_view.h" | 48 #include "views/widget/root_view.h" |
50 #include "views/widget/widget_delegate.h" | 49 #include "views/widget/widget_delegate.h" |
51 | 50 |
52 #pragma comment(lib, "dwmapi.lib") | 51 #pragma comment(lib, "dwmapi.lib") |
53 | 52 |
54 using ui::ViewProp; | 53 using ui::ViewProp; |
55 | 54 |
56 namespace views { | 55 namespace views { |
57 | 56 |
58 namespace { | 57 namespace { |
(...skipping 2346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2405 } | 2404 } |
2406 | 2405 |
2407 namespace internal { | 2406 namespace internal { |
2408 | 2407 |
2409 //////////////////////////////////////////////////////////////////////////////// | 2408 //////////////////////////////////////////////////////////////////////////////// |
2410 // internal::NativeWidgetPrivate, public: | 2409 // internal::NativeWidgetPrivate, public: |
2411 | 2410 |
2412 // static | 2411 // static |
2413 NativeWidgetPrivate* NativeWidgetPrivate::CreateNativeWidget( | 2412 NativeWidgetPrivate* NativeWidgetPrivate::CreateNativeWidget( |
2414 internal::NativeWidgetDelegate* delegate) { | 2413 internal::NativeWidgetDelegate* delegate) { |
2415 if (Widget::IsPureViews() && | |
2416 ViewsDelegate::views_delegate->GetDefaultParentView()) { | |
2417 return new NativeWidgetViews(delegate); | |
2418 } | |
2419 return new NativeWidgetWin(delegate); | 2414 return new NativeWidgetWin(delegate); |
2420 } | 2415 } |
2421 | 2416 |
2422 // static | 2417 // static |
2423 NativeWidgetPrivate* NativeWidgetPrivate::GetNativeWidgetForNativeView( | 2418 NativeWidgetPrivate* NativeWidgetPrivate::GetNativeWidgetForNativeView( |
2424 gfx::NativeView native_view) { | 2419 gfx::NativeView native_view) { |
2425 return reinterpret_cast<NativeWidgetWin*>( | 2420 return reinterpret_cast<NativeWidgetWin*>( |
2426 ViewProp::GetValue(native_view, kNativeWidgetKey)); | 2421 ViewProp::GetValue(native_view, kNativeWidgetKey)); |
2427 } | 2422 } |
2428 | 2423 |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2520 return (GetKeyState(VK_LBUTTON) & 0x80) || | 2515 return (GetKeyState(VK_LBUTTON) & 0x80) || |
2521 (GetKeyState(VK_RBUTTON) & 0x80) || | 2516 (GetKeyState(VK_RBUTTON) & 0x80) || |
2522 (GetKeyState(VK_MBUTTON) & 0x80) || | 2517 (GetKeyState(VK_MBUTTON) & 0x80) || |
2523 (GetKeyState(VK_XBUTTON1) & 0x80) || | 2518 (GetKeyState(VK_XBUTTON1) & 0x80) || |
2524 (GetKeyState(VK_XBUTTON2) & 0x80); | 2519 (GetKeyState(VK_XBUTTON2) & 0x80); |
2525 } | 2520 } |
2526 | 2521 |
2527 } // namespace internal | 2522 } // namespace internal |
2528 | 2523 |
2529 } // namespace views | 2524 } // namespace views |
OLD | NEW |