| 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 11 matching lines...) Expand all Loading... |
| 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" | 31 #include "ui/views/ime/input_method_bridge.h" |
| 32 #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" |
| 42 #include "ui/views/widget/widget_hwnd_utils.h" | 41 #include "ui/views/widget/widget_hwnd_utils.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 60 native_widget_delegate_(native_widget_delegate), | 59 native_widget_delegate_(native_widget_delegate), |
| 61 desktop_native_widget_aura_(desktop_native_widget_aura), | 60 desktop_native_widget_aura_(desktop_native_widget_aura), |
| 62 root_window_host_delegate_(NULL), | 61 root_window_host_delegate_(NULL), |
| 63 content_window_(NULL), | 62 content_window_(NULL), |
| 64 should_animate_window_close_(false), | 63 should_animate_window_close_(false), |
| 65 pending_close_(false), | 64 pending_close_(false), |
| 66 has_non_client_view_(false) { | 65 has_non_client_view_(false) { |
| 67 } | 66 } |
| 68 | 67 |
| 69 DesktopRootWindowHostWin::~DesktopRootWindowHostWin() { | 68 DesktopRootWindowHostWin::~DesktopRootWindowHostWin() { |
| 70 if (corewm::UseFocusControllerOnDesktop()) { | 69 aura::client::SetFocusClient(root_window_, NULL); |
| 71 aura::client::SetFocusClient(root_window_, NULL); | 70 aura::client::SetActivationClient(root_window_, NULL); |
| 72 aura::client::SetActivationClient(root_window_, NULL); | |
| 73 } | |
| 74 } | 71 } |
| 75 | 72 |
| 76 // static | 73 // static |
| 77 aura::Window* DesktopRootWindowHostWin::GetContentWindowForHWND(HWND hwnd) { | 74 aura::Window* DesktopRootWindowHostWin::GetContentWindowForHWND(HWND hwnd) { |
| 78 aura::RootWindow* root = aura::RootWindow::GetForAcceleratedWidget(hwnd); | 75 aura::RootWindow* root = aura::RootWindow::GetForAcceleratedWidget(hwnd); |
| 79 return root ? root->GetProperty(kContentWindowForRootWindow) : NULL; | 76 return root ? root->GetProperty(kContentWindowForRootWindow) : NULL; |
| 80 } | 77 } |
| 81 | 78 |
| 82 // static | 79 // static |
| 83 ui::NativeTheme* DesktopRootWindowHost::GetNativeTheme(aura::Window* window) { | 80 ui::NativeTheme* DesktopRootWindowHost::GetNativeTheme(aura::Window* window) { |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 aura::RootWindow::CreateParams rw_params(params.bounds); | 118 aura::RootWindow::CreateParams rw_params(params.bounds); |
| 122 rw_params.host = this; | 119 rw_params.host = this; |
| 123 root_window_ = new aura::RootWindow(rw_params); | 120 root_window_ = new aura::RootWindow(rw_params); |
| 124 | 121 |
| 125 SetWindowTransparency(); | 122 SetWindowTransparency(); |
| 126 root_window_->Init(); | 123 root_window_->Init(); |
| 127 root_window_->AddChild(content_window_); | 124 root_window_->AddChild(content_window_); |
| 128 | 125 |
| 129 desktop_native_widget_aura_->CreateCaptureClient(root_window_); | 126 desktop_native_widget_aura_->CreateCaptureClient(root_window_); |
| 130 | 127 |
| 131 if (corewm::UseFocusControllerOnDesktop()) { | 128 corewm::FocusController* focus_controller = |
| 132 corewm::FocusController* focus_controller = | 129 new corewm::FocusController(new DesktopFocusRules); |
| 133 new corewm::FocusController(new DesktopFocusRules); | 130 focus_client_.reset(focus_controller); |
| 134 focus_client_.reset(focus_controller); | 131 aura::client::SetFocusClient(root_window_, focus_controller); |
| 135 aura::client::SetFocusClient(root_window_, focus_controller); | 132 aura::client::SetActivationClient(root_window_, focus_controller); |
| 136 aura::client::SetActivationClient(root_window_, focus_controller); | 133 root_window_->AddPreTargetHandler(focus_controller); |
| 137 root_window_->AddPreTargetHandler(focus_controller); | |
| 138 } else { | |
| 139 focus_client_.reset(new aura::FocusManager); | |
| 140 aura::client::SetFocusClient(root_window_, focus_client_.get()); | |
| 141 activation_client_.reset(new DesktopActivationClient(root_window_)); | |
| 142 } | |
| 143 | 134 |
| 144 dispatcher_client_.reset(new DesktopDispatcherClient); | 135 dispatcher_client_.reset(new DesktopDispatcherClient); |
| 145 aura::client::SetDispatcherClient(root_window_, | 136 aura::client::SetDispatcherClient(root_window_, |
| 146 dispatcher_client_.get()); | 137 dispatcher_client_.get()); |
| 147 | 138 |
| 148 cursor_client_.reset( | 139 cursor_client_.reset( |
| 149 new views::corewm::CursorManager( | 140 new views::corewm::CursorManager( |
| 150 scoped_ptr<corewm::NativeCursorManager>( | 141 scoped_ptr<corewm::NativeCursorManager>( |
| 151 new views::DesktopNativeCursorManager( | 142 new views::DesktopNativeCursorManager( |
| 152 root_window_, | 143 root_window_, |
| (...skipping 707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 860 DesktopRootWindowHost* DesktopRootWindowHost::Create( | 851 DesktopRootWindowHost* DesktopRootWindowHost::Create( |
| 861 internal::NativeWidgetDelegate* native_widget_delegate, | 852 internal::NativeWidgetDelegate* native_widget_delegate, |
| 862 DesktopNativeWidgetAura* desktop_native_widget_aura, | 853 DesktopNativeWidgetAura* desktop_native_widget_aura, |
| 863 const gfx::Rect& initial_bounds) { | 854 const gfx::Rect& initial_bounds) { |
| 864 return new DesktopRootWindowHostWin(native_widget_delegate, | 855 return new DesktopRootWindowHostWin(native_widget_delegate, |
| 865 desktop_native_widget_aura, | 856 desktop_native_widget_aura, |
| 866 initial_bounds); | 857 initial_bounds); |
| 867 } | 858 } |
| 868 | 859 |
| 869 } // namespace views | 860 } // namespace views |
| OLD | NEW |