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/desktop_aura/desktop_window_tree_host_win.h" | 5 #include "ui/views/widget/desktop_aura/desktop_window_tree_host_win.h" |
6 | 6 |
7 #include "base/win/metro.h" | 7 #include "base/win/metro.h" |
8 #include "third_party/skia/include/core/SkPath.h" | 8 #include "third_party/skia/include/core/SkPath.h" |
9 #include "third_party/skia/include/core/SkRegion.h" | 9 #include "third_party/skia/include/core/SkRegion.h" |
10 #include "ui/aura/client/aura_constants.h" | 10 #include "ui/aura/client/aura_constants.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 #include "ui/views/widget/desktop_aura/desktop_cursor_loader_updater.h" | 30 #include "ui/views/widget/desktop_aura/desktop_cursor_loader_updater.h" |
31 #include "ui/views/widget/desktop_aura/desktop_drag_drop_client_win.h" | 31 #include "ui/views/widget/desktop_aura/desktop_drag_drop_client_win.h" |
32 #include "ui/views/widget/desktop_aura/desktop_native_cursor_manager.h" | 32 #include "ui/views/widget/desktop_aura/desktop_native_cursor_manager.h" |
33 #include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h" | 33 #include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h" |
34 #include "ui/views/widget/root_view.h" | 34 #include "ui/views/widget/root_view.h" |
35 #include "ui/views/widget/widget_delegate.h" | 35 #include "ui/views/widget/widget_delegate.h" |
36 #include "ui/views/widget/widget_hwnd_utils.h" | 36 #include "ui/views/widget/widget_hwnd_utils.h" |
37 #include "ui/views/win/fullscreen_handler.h" | 37 #include "ui/views/win/fullscreen_handler.h" |
38 #include "ui/views/win/hwnd_message_handler.h" | 38 #include "ui/views/win/hwnd_message_handler.h" |
39 #include "ui/wm/core/compound_event_filter.h" | 39 #include "ui/wm/core/compound_event_filter.h" |
40 #include "ui/wm/core/input_method_event_filter.h" | |
41 #include "ui/wm/core/window_animations.h" | 40 #include "ui/wm/core/window_animations.h" |
42 #include "ui/wm/public/scoped_tooltip_disabler.h" | 41 #include "ui/wm/public/scoped_tooltip_disabler.h" |
43 | 42 |
44 DECLARE_WINDOW_PROPERTY_TYPE(views::DesktopWindowTreeHostWin*); | 43 DECLARE_WINDOW_PROPERTY_TYPE(views::DesktopWindowTreeHostWin*); |
45 | 44 |
46 namespace views { | 45 namespace views { |
47 | 46 |
48 namespace { | 47 namespace { |
49 | 48 |
50 gfx::Size GetExpandedWindowSize(DWORD window_style, gfx::Size size) { | 49 gfx::Size GetExpandedWindowSize(DWORD window_style, gfx::Size size) { |
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
553 ::ShowCursor(!!show); | 552 ::ShowCursor(!!show); |
554 } | 553 } |
555 | 554 |
556 void DesktopWindowTreeHostWin::MoveCursorToNative(const gfx::Point& location) { | 555 void DesktopWindowTreeHostWin::MoveCursorToNative(const gfx::Point& location) { |
557 POINT cursor_location = location.ToPOINT(); | 556 POINT cursor_location = location.ToPOINT(); |
558 ::ClientToScreen(GetHWND(), &cursor_location); | 557 ::ClientToScreen(GetHWND(), &cursor_location); |
559 ::SetCursorPos(cursor_location.x, cursor_location.y); | 558 ::SetCursorPos(cursor_location.x, cursor_location.y); |
560 } | 559 } |
561 | 560 |
562 //////////////////////////////////////////////////////////////////////////////// | 561 //////////////////////////////////////////////////////////////////////////////// |
563 // DesktopWindowTreeHostWin, ui::EventSource implementation: | |
564 | |
565 ui::EventProcessor* DesktopWindowTreeHostWin::GetEventProcessor() { | |
566 return dispatcher(); | |
567 } | |
568 | |
569 //////////////////////////////////////////////////////////////////////////////// | |
570 // DesktopWindowTreeHostWin, aura::AnimationHost implementation: | 562 // DesktopWindowTreeHostWin, aura::AnimationHost implementation: |
571 | 563 |
572 void DesktopWindowTreeHostWin::SetHostTransitionOffsets( | 564 void DesktopWindowTreeHostWin::SetHostTransitionOffsets( |
573 const gfx::Vector2d& top_left_delta, | 565 const gfx::Vector2d& top_left_delta, |
574 const gfx::Vector2d& bottom_right_delta) { | 566 const gfx::Vector2d& bottom_right_delta) { |
575 gfx::Rect bounds_without_expansion = GetBounds(); | 567 gfx::Rect bounds_without_expansion = GetBounds(); |
576 window_expansion_top_left_delta_ = top_left_delta; | 568 window_expansion_top_left_delta_ = top_left_delta; |
577 window_expansion_bottom_right_delta_ = bottom_right_delta; | 569 window_expansion_bottom_right_delta_ = bottom_right_delta; |
578 SetBounds(bounds_without_expansion); | 570 SetBounds(bounds_without_expansion); |
579 } | 571 } |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
675 } | 667 } |
676 | 668 |
677 void DesktopWindowTreeHostWin::ResetWindowControls() { | 669 void DesktopWindowTreeHostWin::ResetWindowControls() { |
678 GetWidget()->non_client_view()->ResetWindowControls(); | 670 GetWidget()->non_client_view()->ResetWindowControls(); |
679 } | 671 } |
680 | 672 |
681 gfx::NativeViewAccessible DesktopWindowTreeHostWin::GetNativeViewAccessible() { | 673 gfx::NativeViewAccessible DesktopWindowTreeHostWin::GetNativeViewAccessible() { |
682 return GetWidget()->GetRootView()->GetNativeViewAccessible(); | 674 return GetWidget()->GetRootView()->GetNativeViewAccessible(); |
683 } | 675 } |
684 | 676 |
685 InputMethod* DesktopWindowTreeHostWin::GetInputMethod() { | |
686 return GetWidget()->GetInputMethodDirect(); | |
687 } | |
688 | |
689 bool DesktopWindowTreeHostWin::ShouldHandleSystemCommands() const { | 677 bool DesktopWindowTreeHostWin::ShouldHandleSystemCommands() const { |
690 return GetWidget()->widget_delegate()->ShouldHandleSystemCommands(); | 678 return GetWidget()->widget_delegate()->ShouldHandleSystemCommands(); |
691 } | 679 } |
692 | 680 |
693 void DesktopWindowTreeHostWin::HandleAppDeactivated() { | 681 void DesktopWindowTreeHostWin::HandleAppDeactivated() { |
694 native_widget_delegate_->EnableInactiveRendering(); | 682 native_widget_delegate_->EnableInactiveRendering(); |
695 } | 683 } |
696 | 684 |
697 void DesktopWindowTreeHostWin::HandleActivationChanged(bool active) { | 685 void DesktopWindowTreeHostWin::HandleActivationChanged(bool active) { |
698 // This can be invoked from HWNDMessageHandler::Init(), at which point we're | 686 // This can be invoked from HWNDMessageHandler::Init(), at which point we're |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
852 | 840 |
853 bool DesktopWindowTreeHostWin::HandleIMEMessage(UINT message, | 841 bool DesktopWindowTreeHostWin::HandleIMEMessage(UINT message, |
854 WPARAM w_param, | 842 WPARAM w_param, |
855 LPARAM l_param, | 843 LPARAM l_param, |
856 LRESULT* result) { | 844 LRESULT* result) { |
857 MSG msg = {}; | 845 MSG msg = {}; |
858 msg.hwnd = GetHWND(); | 846 msg.hwnd = GetHWND(); |
859 msg.message = message; | 847 msg.message = message; |
860 msg.wParam = w_param; | 848 msg.wParam = w_param; |
861 msg.lParam = l_param; | 849 msg.lParam = l_param; |
862 return desktop_native_widget_aura_->input_method_event_filter()-> | 850 return GetInputMethod()->OnUntranslatedIMEMessage(msg, result); |
863 input_method()->OnUntranslatedIMEMessage(msg, result); | |
864 } | 851 } |
865 | 852 |
866 void DesktopWindowTreeHostWin::HandleInputLanguageChange( | 853 void DesktopWindowTreeHostWin::HandleInputLanguageChange( |
867 DWORD character_set, | 854 DWORD character_set, |
868 HKL input_language_id) { | 855 HKL input_language_id) { |
869 desktop_native_widget_aura_->input_method_event_filter()-> | 856 GetInputMethod()->OnInputLocaleChanged(); |
870 input_method()->OnInputLocaleChanged(); | |
871 } | 857 } |
872 | 858 |
873 void DesktopWindowTreeHostWin::HandlePaintAccelerated( | 859 void DesktopWindowTreeHostWin::HandlePaintAccelerated( |
874 const gfx::Rect& invalid_rect) { | 860 const gfx::Rect& invalid_rect) { |
875 if (compositor()) | 861 if (compositor()) |
876 compositor()->ScheduleRedrawRect(invalid_rect); | 862 compositor()->ScheduleRedrawRect(invalid_rect); |
877 } | 863 } |
878 | 864 |
879 bool DesktopWindowTreeHostWin::HandleTooltipNotify(int w_param, | 865 bool DesktopWindowTreeHostWin::HandleTooltipNotify(int w_param, |
880 NMHDR* l_param, | 866 NMHDR* l_param, |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
958 | 944 |
959 // static | 945 // static |
960 DesktopWindowTreeHost* DesktopWindowTreeHost::Create( | 946 DesktopWindowTreeHost* DesktopWindowTreeHost::Create( |
961 internal::NativeWidgetDelegate* native_widget_delegate, | 947 internal::NativeWidgetDelegate* native_widget_delegate, |
962 DesktopNativeWidgetAura* desktop_native_widget_aura) { | 948 DesktopNativeWidgetAura* desktop_native_widget_aura) { |
963 return new DesktopWindowTreeHostWin(native_widget_delegate, | 949 return new DesktopWindowTreeHostWin(native_widget_delegate, |
964 desktop_native_widget_aura); | 950 desktop_native_widget_aura); |
965 } | 951 } |
966 | 952 |
967 } // namespace views | 953 } // namespace views |
OLD | NEW |