| 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_root_window_host_win.h" | 5 #include "ui/views/widget/desktop_aura/desktop_root_window_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 10 matching lines...) Expand all Loading... |
| 21 #include "ui/gfx/native_widget_types.h" | 21 #include "ui/gfx/native_widget_types.h" |
| 22 #include "ui/gfx/path_win.h" | 22 #include "ui/gfx/path_win.h" |
| 23 #include "ui/native_theme/native_theme_aura.h" | 23 #include "ui/native_theme/native_theme_aura.h" |
| 24 #include "ui/native_theme/native_theme_win.h" | 24 #include "ui/native_theme/native_theme_win.h" |
| 25 #include "ui/views/corewm/compound_event_filter.h" | 25 #include "ui/views/corewm/compound_event_filter.h" |
| 26 #include "ui/views/corewm/corewm_switches.h" | 26 #include "ui/views/corewm/corewm_switches.h" |
| 27 #include "ui/views/corewm/cursor_manager.h" | 27 #include "ui/views/corewm/cursor_manager.h" |
| 28 #include "ui/views/corewm/focus_controller.h" | 28 #include "ui/views/corewm/focus_controller.h" |
| 29 #include "ui/views/corewm/input_method_event_filter.h" | 29 #include "ui/views/corewm/input_method_event_filter.h" |
| 30 #include "ui/views/corewm/window_animations.h" | 30 #include "ui/views/corewm/window_animations.h" |
| 31 #include "ui/views/ime/input_method_bridge.h" | |
| 32 #include "ui/views/widget/desktop_aura/desktop_activation_client.h" | 31 #include "ui/views/widget/desktop_aura/desktop_activation_client.h" |
| 33 #include "ui/views/widget/desktop_aura/desktop_cursor_loader_updater.h" | 32 #include "ui/views/widget/desktop_aura/desktop_cursor_loader_updater.h" |
| 34 #include "ui/views/widget/desktop_aura/desktop_dispatcher_client.h" | 33 #include "ui/views/widget/desktop_aura/desktop_dispatcher_client.h" |
| 35 #include "ui/views/widget/desktop_aura/desktop_drag_drop_client_win.h" | 34 #include "ui/views/widget/desktop_aura/desktop_drag_drop_client_win.h" |
| 36 #include "ui/views/widget/desktop_aura/desktop_focus_rules.h" | 35 #include "ui/views/widget/desktop_aura/desktop_focus_rules.h" |
| 37 #include "ui/views/widget/desktop_aura/desktop_native_cursor_manager.h" | 36 #include "ui/views/widget/desktop_aura/desktop_native_cursor_manager.h" |
| 38 #include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h" | 37 #include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h" |
| 39 #include "ui/views/widget/desktop_aura/desktop_screen_position_client.h" | 38 #include "ui/views/widget/desktop_aura/desktop_screen_position_client.h" |
| 40 #include "ui/views/widget/root_view.h" | 39 #include "ui/views/widget/root_view.h" |
| 41 #include "ui/views/widget/widget_delegate.h" | 40 #include "ui/views/widget/widget_delegate.h" |
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 372 } | 371 } |
| 373 | 372 |
| 374 void DesktopRootWindowHostWin::InitModalType(ui::ModalType modal_type) { | 373 void DesktopRootWindowHostWin::InitModalType(ui::ModalType modal_type) { |
| 375 message_handler_->InitModalType(modal_type); | 374 message_handler_->InitModalType(modal_type); |
| 376 } | 375 } |
| 377 | 376 |
| 378 void DesktopRootWindowHostWin::FlashFrame(bool flash_frame) { | 377 void DesktopRootWindowHostWin::FlashFrame(bool flash_frame) { |
| 379 message_handler_->FlashFrame(flash_frame); | 378 message_handler_->FlashFrame(flash_frame); |
| 380 } | 379 } |
| 381 | 380 |
| 382 void DesktopRootWindowHostWin::OnNativeWidgetFocus() { | |
| 383 // HWNDMessageHandler will perform the proper updating on its own. | |
| 384 } | |
| 385 | |
| 386 void DesktopRootWindowHostWin::OnNativeWidgetBlur() { | |
| 387 } | |
| 388 | |
| 389 //////////////////////////////////////////////////////////////////////////////// | 381 //////////////////////////////////////////////////////////////////////////////// |
| 390 // DesktopRootWindowHostWin, RootWindowHost implementation: | 382 // DesktopRootWindowHostWin, RootWindowHost implementation: |
| 391 | 383 |
| 392 | 384 |
| 393 void DesktopRootWindowHostWin::SetDelegate( | 385 void DesktopRootWindowHostWin::SetDelegate( |
| 394 aura::RootWindowHostDelegate* delegate) { | 386 aura::RootWindowHostDelegate* delegate) { |
| 395 root_window_host_delegate_ = delegate; | 387 root_window_host_delegate_ = delegate; |
| 396 } | 388 } |
| 397 | 389 |
| 398 aura::RootWindow* DesktopRootWindowHostWin::GetRootWindow() { | 390 aura::RootWindow* DesktopRootWindowHostWin::GetRootWindow() { |
| (...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 754 native_widget_delegate_->OnNativeWidgetSizeChanged(dip_size); | 746 native_widget_delegate_->OnNativeWidgetSizeChanged(dip_size); |
| 755 } | 747 } |
| 756 | 748 |
| 757 void DesktopRootWindowHostWin::HandleFrameChanged() { | 749 void DesktopRootWindowHostWin::HandleFrameChanged() { |
| 758 // Replace the frame and layout the contents. | 750 // Replace the frame and layout the contents. |
| 759 GetWidget()->non_client_view()->UpdateFrame(true); | 751 GetWidget()->non_client_view()->UpdateFrame(true); |
| 760 } | 752 } |
| 761 | 753 |
| 762 void DesktopRootWindowHostWin::HandleNativeFocus(HWND last_focused_window) { | 754 void DesktopRootWindowHostWin::HandleNativeFocus(HWND last_focused_window) { |
| 763 // TODO(beng): inform the native_widget_delegate_. | 755 // TODO(beng): inform the native_widget_delegate_. |
| 764 InputMethod* input_method = GetInputMethod(); | |
| 765 if (input_method) | |
| 766 input_method->OnFocus(); | |
| 767 } | 756 } |
| 768 | 757 |
| 769 void DesktopRootWindowHostWin::HandleNativeBlur(HWND focused_window) { | 758 void DesktopRootWindowHostWin::HandleNativeBlur(HWND focused_window) { |
| 770 // TODO(beng): inform the native_widget_delegate_. | 759 // TODO(beng): inform the native_widget_delegate_. |
| 771 InputMethod* input_method = GetInputMethod(); | |
| 772 if (input_method) | |
| 773 input_method->OnBlur(); | |
| 774 } | 760 } |
| 775 | 761 |
| 776 bool DesktopRootWindowHostWin::HandleMouseEvent(const ui::MouseEvent& event) { | 762 bool DesktopRootWindowHostWin::HandleMouseEvent(const ui::MouseEvent& event) { |
| 777 if (base::win::IsTSFAwareRequired() && event.IsAnyButton()) | 763 if (base::win::IsTSFAwareRequired() && event.IsAnyButton()) |
| 778 ui::TSFBridge::GetInstance()->CancelComposition(); | 764 ui::TSFBridge::GetInstance()->CancelComposition(); |
| 779 return root_window_host_delegate_->OnHostMouseEvent( | 765 return root_window_host_delegate_->OnHostMouseEvent( |
| 780 const_cast<ui::MouseEvent*>(&event)); | 766 const_cast<ui::MouseEvent*>(&event)); |
| 781 } | 767 } |
| 782 | 768 |
| 783 bool DesktopRootWindowHostWin::HandleKeyEvent(const ui::KeyEvent& event) { | 769 bool DesktopRootWindowHostWin::HandleKeyEvent(const ui::KeyEvent& event) { |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 871 DesktopRootWindowHost* DesktopRootWindowHost::Create( | 857 DesktopRootWindowHost* DesktopRootWindowHost::Create( |
| 872 internal::NativeWidgetDelegate* native_widget_delegate, | 858 internal::NativeWidgetDelegate* native_widget_delegate, |
| 873 DesktopNativeWidgetAura* desktop_native_widget_aura, | 859 DesktopNativeWidgetAura* desktop_native_widget_aura, |
| 874 const gfx::Rect& initial_bounds) { | 860 const gfx::Rect& initial_bounds) { |
| 875 return new DesktopRootWindowHostWin(native_widget_delegate, | 861 return new DesktopRootWindowHostWin(native_widget_delegate, |
| 876 desktop_native_widget_aura, | 862 desktop_native_widget_aura, |
| 877 initial_bounds); | 863 initial_bounds); |
| 878 } | 864 } |
| 879 | 865 |
| 880 } // namespace views | 866 } // namespace views |
| OLD | NEW |