| 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_root_window_host_win.h" | 5 #include "ui/views/widget/desktop_root_window_host_win.h" |
| 6 | 6 |
| 7 #include "ui/aura/desktop/desktop_activation_client.h" | 7 #include "ui/aura/desktop/desktop_activation_client.h" |
| 8 #include "ui/aura/desktop/desktop_cursor_client.h" |
| 8 #include "ui/aura/desktop/desktop_dispatcher_client.h" | 9 #include "ui/aura/desktop/desktop_dispatcher_client.h" |
| 9 #include "ui/aura/focus_manager.h" | 10 #include "ui/aura/focus_manager.h" |
| 10 #include "ui/aura/root_window.h" | 11 #include "ui/aura/root_window.h" |
| 11 #include "ui/aura/shared/compound_event_filter.h" | 12 #include "ui/aura/shared/compound_event_filter.h" |
| 13 #include "ui/base/cursor/cursor_loader_win.h" |
| 12 #include "ui/base/win/shell.h" | 14 #include "ui/base/win/shell.h" |
| 13 #include "ui/views/ime/input_method_win.h" | 15 #include "ui/views/ime/input_method_win.h" |
| 14 #include "ui/views/widget/desktop_capture_client.h" | 16 #include "ui/views/widget/desktop_capture_client.h" |
| 17 #include "ui/views/widget/desktop_screen_position_client_aura.h" |
| 15 #include "ui/views/win/hwnd_message_handler.h" | 18 #include "ui/views/win/hwnd_message_handler.h" |
| 16 | 19 |
| 17 namespace views { | 20 namespace views { |
| 18 | 21 |
| 19 //////////////////////////////////////////////////////////////////////////////// | 22 //////////////////////////////////////////////////////////////////////////////// |
| 20 // DesktopRootWindowHostWin, public: | 23 // DesktopRootWindowHostWin, public: |
| 21 | 24 |
| 22 DesktopRootWindowHostWin::DesktopRootWindowHostWin( | 25 DesktopRootWindowHostWin::DesktopRootWindowHostWin( |
| 23 internal::NativeWidgetDelegate* native_widget_delegate, | 26 internal::NativeWidgetDelegate* native_widget_delegate, |
| 24 const gfx::Rect& initial_bounds) | 27 const gfx::Rect& initial_bounds) |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 | 63 |
| 61 activation_client_.reset( | 64 activation_client_.reset( |
| 62 new aura::DesktopActivationClient(root_window_->GetFocusManager())); | 65 new aura::DesktopActivationClient(root_window_->GetFocusManager())); |
| 63 aura::client::SetActivationClient(root_window_.get(), | 66 aura::client::SetActivationClient(root_window_.get(), |
| 64 activation_client_.get()); | 67 activation_client_.get()); |
| 65 | 68 |
| 66 dispatcher_client_.reset(new aura::DesktopDispatcherClient); | 69 dispatcher_client_.reset(new aura::DesktopDispatcherClient); |
| 67 aura::client::SetDispatcherClient(root_window_.get(), | 70 aura::client::SetDispatcherClient(root_window_.get(), |
| 68 dispatcher_client_.get()); | 71 dispatcher_client_.get()); |
| 69 | 72 |
| 73 cursor_client_.reset(new aura::DesktopCursorClient(root_window_.get())); |
| 74 aura::client::SetCursorClient(root_window_.get(), cursor_client_.get()); |
| 75 |
| 76 |
| 77 position_client_.reset(new DesktopScreenPositionClient()); |
| 78 aura::client::SetScreenPositionClient(root_window_.get(), |
| 79 position_client_.get()); |
| 80 |
| 70 // CEF sets focus to the window the user clicks down on. | 81 // CEF sets focus to the window the user clicks down on. |
| 71 // TODO(beng): see if we can't do this some other way. CEF seems a heavy- | 82 // TODO(beng): see if we can't do this some other way. CEF seems a heavy- |
| 72 // handed way of accomplishing focus. | 83 // handed way of accomplishing focus. |
| 73 root_window_->SetEventFilter(new aura::shared::CompoundEventFilter); | 84 root_window_->SetEventFilter(new aura::shared::CompoundEventFilter); |
| 74 } | 85 } |
| 75 | 86 |
| 76 void DesktopRootWindowHostWin::Close() { | 87 void DesktopRootWindowHostWin::Close() { |
| 77 message_handler_->Close(); | 88 message_handler_->Close(); |
| 78 } | 89 } |
| 79 | 90 |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 return gfx::Point(1, 1); | 226 return gfx::Point(1, 1); |
| 216 } | 227 } |
| 217 | 228 |
| 218 void DesktopRootWindowHostWin::SetCapture() { | 229 void DesktopRootWindowHostWin::SetCapture() { |
| 219 } | 230 } |
| 220 | 231 |
| 221 void DesktopRootWindowHostWin::ReleaseCapture() { | 232 void DesktopRootWindowHostWin::ReleaseCapture() { |
| 222 } | 233 } |
| 223 | 234 |
| 224 void DesktopRootWindowHostWin::SetCursor(gfx::NativeCursor cursor) { | 235 void DesktopRootWindowHostWin::SetCursor(gfx::NativeCursor cursor) { |
| 236 // Custom web cursors are handled directly. |
| 237 if (cursor == ui::kCursorCustom) |
| 238 return; |
| 239 ui::CursorLoaderWin cursor_loader; |
| 240 cursor_loader.SetPlatformCursor(&cursor); |
| 241 |
| 242 message_handler_->SetCursor(cursor.platform()); |
| 225 } | 243 } |
| 226 | 244 |
| 227 void DesktopRootWindowHostWin::ShowCursor(bool show) { | 245 void DesktopRootWindowHostWin::ShowCursor(bool show) { |
| 228 } | 246 } |
| 229 | 247 |
| 230 bool DesktopRootWindowHostWin::QueryMouseLocation(gfx::Point* location_return) { | 248 bool DesktopRootWindowHostWin::QueryMouseLocation(gfx::Point* location_return) { |
| 231 return false; | 249 return false; |
| 232 } | 250 } |
| 233 | 251 |
| 234 bool DesktopRootWindowHostWin::ConfineCursorToRootWindow() { | 252 bool DesktopRootWindowHostWin::ConfineCursorToRootWindow() { |
| (...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 528 // DesktopRootWindowHost, public: | 546 // DesktopRootWindowHost, public: |
| 529 | 547 |
| 530 // static | 548 // static |
| 531 DesktopRootWindowHost* DesktopRootWindowHost::Create( | 549 DesktopRootWindowHost* DesktopRootWindowHost::Create( |
| 532 internal::NativeWidgetDelegate* native_widget_delegate, | 550 internal::NativeWidgetDelegate* native_widget_delegate, |
| 533 const gfx::Rect& initial_bounds) { | 551 const gfx::Rect& initial_bounds) { |
| 534 return new DesktopRootWindowHostWin(native_widget_delegate, initial_bounds); | 552 return new DesktopRootWindowHostWin(native_widget_delegate, initial_bounds); |
| 535 } | 553 } |
| 536 | 554 |
| 537 } // namespace views | 555 } // namespace views |
| OLD | NEW |