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_native_widget_aura.h" | 5 #include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
9 #include "ui/aura/client/aura_constants.h" | 9 #include "ui/aura/client/aura_constants.h" |
10 #include "ui/aura/client/cursor_client.h" | 10 #include "ui/aura/client/cursor_client.h" |
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
434 if (widget_type_ == Widget::InitParams::TYPE_WINDOW) | 434 if (widget_type_ == Widget::InitParams::TYPE_WINDOW) |
435 window_modality_controller_.reset( | 435 window_modality_controller_.reset( |
436 new wm::WindowModalityController(host_->window())); | 436 new wm::WindowModalityController(host_->window())); |
437 | 437 |
438 // |root_window_event_filter_| must be created before | 438 // |root_window_event_filter_| must be created before |
439 // OnWindowTreeHostCreated() is invoked. | 439 // OnWindowTreeHostCreated() is invoked. |
440 | 440 |
441 // CEF sets focus to the window the user clicks down on. | 441 // CEF sets focus to the window the user clicks down on. |
442 // TODO(beng): see if we can't do this some other way. CEF seems a heavy- | 442 // TODO(beng): see if we can't do this some other way. CEF seems a heavy- |
443 // handed way of accomplishing focus. | 443 // handed way of accomplishing focus. |
444 // No event filter for aura::Env. Create CompoundEvnetFilter per | 444 // No event filter for aura::Env. Create CompoundEventFilter per |
445 // WindowEventDispatcher. | 445 // WindowEventDispatcher. |
446 root_window_event_filter_.reset(new wm::CompoundEventFilter); | 446 root_window_event_filter_.reset(new wm::CompoundEventFilter); |
447 host_->window()->AddPreTargetHandler(root_window_event_filter_.get()); | 447 host_->window()->AddPreTargetHandler(root_window_event_filter_.get()); |
448 | 448 |
449 // The host's dispatcher must be added to |native_cursor_manager_| before | 449 // The host's dispatcher must be added to |native_cursor_manager_| before |
450 // OnNativeWidgetCreated() is called. | 450 // OnNativeWidgetCreated() is called. |
451 cursor_reference_count_++; | 451 cursor_reference_count_++; |
452 if (!native_cursor_manager_) { | 452 if (!native_cursor_manager_) { |
453 native_cursor_manager_ = new DesktopNativeCursorManager( | 453 native_cursor_manager_ = new DesktopNativeCursorManager( |
454 DesktopCursorLoaderUpdater::Create()); | 454 DesktopCursorLoaderUpdater::Create()); |
(...skipping 753 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1208 if (cursor_reference_count_ == 0) { | 1208 if (cursor_reference_count_ == 0) { |
1209 // We are the last DesktopNativeWidgetAura instance, and we are responsible | 1209 // We are the last DesktopNativeWidgetAura instance, and we are responsible |
1210 // for cleaning up |cursor_manager_|. | 1210 // for cleaning up |cursor_manager_|. |
1211 delete cursor_manager_; | 1211 delete cursor_manager_; |
1212 native_cursor_manager_ = NULL; | 1212 native_cursor_manager_ = NULL; |
1213 cursor_manager_ = NULL; | 1213 cursor_manager_ = NULL; |
1214 } | 1214 } |
1215 } | 1215 } |
1216 | 1216 |
1217 } // namespace views | 1217 } // namespace views |
OLD | NEW |