| 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 "third_party/skia/include/core/SkPath.h" | 7 #include "third_party/skia/include/core/SkPath.h" |
| 8 #include "third_party/skia/include/core/SkRegion.h" | 8 #include "third_party/skia/include/core/SkRegion.h" |
| 9 #include "ui/aura/client/aura_constants.h" | 9 #include "ui/aura/client/aura_constants.h" |
| 10 #include "ui/aura/client/default_capture_client.h" | 10 #include "ui/aura/client/default_capture_client.h" |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 root_window_->SetTransparent(true); | 110 root_window_->SetTransparent(true); |
| 111 | 111 |
| 112 root_window_->Init(); | 112 root_window_->Init(); |
| 113 root_window_->AddChild(content_window_); | 113 root_window_->AddChild(content_window_); |
| 114 | 114 |
| 115 native_widget_delegate_->OnNativeWidgetCreated(); | 115 native_widget_delegate_->OnNativeWidgetCreated(); |
| 116 | 116 |
| 117 capture_client_.reset(new aura::client::DefaultCaptureClient(root_window_)); | 117 capture_client_.reset(new aura::client::DefaultCaptureClient(root_window_)); |
| 118 aura::client::SetCaptureClient(root_window_, capture_client_.get()); | 118 aura::client::SetCaptureClient(root_window_, capture_client_.get()); |
| 119 | 119 |
| 120 focus_manager_.reset(new aura::FocusManager); | 120 focus_client_.reset(new aura::FocusManager); |
| 121 root_window_->set_focus_manager(focus_manager_.get()); | 121 aura::client::SetFocusClient(root_window_, focus_client_.get()); |
| 122 | 122 |
| 123 activation_client_.reset(new DesktopActivationClient(root_window_)); | 123 activation_client_.reset(new DesktopActivationClient(root_window_)); |
| 124 | 124 |
| 125 dispatcher_client_.reset(new DesktopDispatcherClient); | 125 dispatcher_client_.reset(new DesktopDispatcherClient); |
| 126 aura::client::SetDispatcherClient(root_window_, | 126 aura::client::SetDispatcherClient(root_window_, |
| 127 dispatcher_client_.get()); | 127 dispatcher_client_.get()); |
| 128 | 128 |
| 129 cursor_client_.reset(new DesktopCursorClient(root_window_)); | 129 cursor_client_.reset(new DesktopCursorClient(root_window_)); |
| 130 aura::client::SetCursorClient(root_window_, cursor_client_.get()); | 130 aura::client::SetCursorClient(root_window_, cursor_client_.get()); |
| 131 | 131 |
| 132 | 132 |
| 133 position_client_.reset(new DesktopScreenPositionClient()); | 133 position_client_.reset(new DesktopScreenPositionClient()); |
| 134 aura::client::SetScreenPositionClient(root_window_, | 134 aura::client::SetScreenPositionClient(root_window_, |
| 135 position_client_.get()); | 135 position_client_.get()); |
| 136 | 136 |
| 137 // CEF sets focus to the window the user clicks down on. | 137 // CEF sets focus to the window the user clicks down on. |
| 138 // TODO(beng): see if we can't do this some other way. CEF seems a heavy- | 138 // TODO(beng): see if we can't do this some other way. CEF seems a heavy- |
| 139 // handed way of accomplishing focus. | 139 // handed way of accomplishing focus. |
| 140 root_window_event_filter_ = new views::corewm::CompoundEventFilter; | 140 root_window_event_filter_ = new views::corewm::CompoundEventFilter; |
| 141 root_window_->SetEventFilter(root_window_event_filter_); | 141 root_window_->SetEventFilter(root_window_event_filter_); |
| 142 | 142 |
| 143 input_method_filter_.reset(new views::corewm::InputMethodEventFilter); | 143 input_method_filter_.reset(new views::corewm::InputMethodEventFilter); |
| 144 input_method_filter_->SetInputMethodPropertyInRootWindow(root_window_); | 144 input_method_filter_->SetInputMethodPropertyInRootWindow(root_window_); |
| 145 root_window_event_filter_->AddHandler(input_method_filter_.get()); | 145 root_window_event_filter_->AddHandler(input_method_filter_.get()); |
| 146 | 146 |
| 147 focus_manager_->SetFocusedWindow(content_window_, NULL); | 147 focus_client_->FocusWindow(content_window_, NULL); |
| 148 root_window_->SetProperty(kContentWindowForRootWindow, content_window_); | 148 root_window_->SetProperty(kContentWindowForRootWindow, content_window_); |
| 149 | 149 |
| 150 ui_controls::InstallUIControlsAura(CreateUIControlsAura(root_window_)); | 150 ui_controls::InstallUIControlsAura(CreateUIControlsAura(root_window_)); |
| 151 return root_window_; | 151 return root_window_; |
| 152 } | 152 } |
| 153 | 153 |
| 154 void DesktopRootWindowHostWin::Close() { | 154 void DesktopRootWindowHostWin::Close() { |
| 155 message_handler_->Close(); | 155 message_handler_->Close(); |
| 156 } | 156 } |
| 157 | 157 |
| (...skipping 629 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 787 DesktopRootWindowHost* DesktopRootWindowHost::Create( | 787 DesktopRootWindowHost* DesktopRootWindowHost::Create( |
| 788 internal::NativeWidgetDelegate* native_widget_delegate, | 788 internal::NativeWidgetDelegate* native_widget_delegate, |
| 789 DesktopNativeWidgetAura* desktop_native_widget_aura, | 789 DesktopNativeWidgetAura* desktop_native_widget_aura, |
| 790 const gfx::Rect& initial_bounds) { | 790 const gfx::Rect& initial_bounds) { |
| 791 return new DesktopRootWindowHostWin(native_widget_delegate, | 791 return new DesktopRootWindowHostWin(native_widget_delegate, |
| 792 desktop_native_widget_aura, | 792 desktop_native_widget_aura, |
| 793 initial_bounds); | 793 initial_bounds); |
| 794 } | 794 } |
| 795 | 795 |
| 796 } // namespace views | 796 } // namespace views |
| OLD | NEW |