| 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" |
| 11 #include "ui/aura/client/focus_client.h" | 11 #include "ui/aura/client/focus_client.h" |
| 12 #include "ui/aura/client/window_tree_client.h" | 12 #include "ui/aura/client/window_tree_client.h" |
| 13 #include "ui/aura/window.h" | 13 #include "ui/aura/window.h" |
| 14 #include "ui/aura/window_observer.h" | 14 #include "ui/aura/window_observer.h" |
| 15 #include "ui/aura/window_property.h" | 15 #include "ui/aura/window_property.h" |
| 16 #include "ui/aura/window_tree_host.h" | 16 #include "ui/aura/window_tree_host.h" |
| 17 #include "ui/base/hit_test.h" | 17 #include "ui/base/hit_test.h" |
| 18 #include "ui/base/ui_base_switches_util.h" | 18 #include "ui/base/ui_base_switches_util.h" |
| 19 #include "ui/compositor/compositor.h" |
| 19 #include "ui/compositor/layer.h" | 20 #include "ui/compositor/layer.h" |
| 20 #include "ui/gfx/canvas.h" | 21 #include "ui/gfx/canvas.h" |
| 21 #include "ui/gfx/display.h" | 22 #include "ui/gfx/display.h" |
| 22 #include "ui/gfx/point_conversions.h" | 23 #include "ui/gfx/point_conversions.h" |
| 23 #include "ui/gfx/screen.h" | 24 #include "ui/gfx/screen.h" |
| 24 #include "ui/gfx/size_conversions.h" | 25 #include "ui/gfx/size_conversions.h" |
| 25 #include "ui/native_theme/native_theme.h" | 26 #include "ui/native_theme/native_theme.h" |
| 26 #include "ui/views/corewm/tooltip.h" | 27 #include "ui/views/corewm/tooltip.h" |
| 27 #include "ui/views/corewm/tooltip_controller.h" | 28 #include "ui/views/corewm/tooltip_controller.h" |
| 28 #include "ui/views/drag_utils.h" | 29 #include "ui/views/drag_utils.h" |
| 29 #include "ui/views/ime/input_method_bridge.h" | 30 #include "ui/views/ime/input_method_bridge.h" |
| 30 #include "ui/views/ime/null_input_method.h" | 31 #include "ui/views/ime/null_input_method.h" |
| 31 #include "ui/views/view_constants_aura.h" | 32 #include "ui/views/view_constants_aura.h" |
| 33 #include "ui/views/views_delegate.h" |
| 32 #include "ui/views/widget/desktop_aura/desktop_capture_client.h" | 34 #include "ui/views/widget/desktop_aura/desktop_capture_client.h" |
| 33 #include "ui/views/widget/desktop_aura/desktop_cursor_loader_updater.h" | 35 #include "ui/views/widget/desktop_aura/desktop_cursor_loader_updater.h" |
| 34 #include "ui/views/widget/desktop_aura/desktop_dispatcher_client.h" | 36 #include "ui/views/widget/desktop_aura/desktop_dispatcher_client.h" |
| 35 #include "ui/views/widget/desktop_aura/desktop_event_client.h" | 37 #include "ui/views/widget/desktop_aura/desktop_event_client.h" |
| 36 #include "ui/views/widget/desktop_aura/desktop_focus_rules.h" | 38 #include "ui/views/widget/desktop_aura/desktop_focus_rules.h" |
| 37 #include "ui/views/widget/desktop_aura/desktop_native_cursor_manager.h" | 39 #include "ui/views/widget/desktop_aura/desktop_native_cursor_manager.h" |
| 38 #include "ui/views/widget/desktop_aura/desktop_screen_position_client.h" | 40 #include "ui/views/widget/desktop_aura/desktop_screen_position_client.h" |
| 39 #include "ui/views/widget/desktop_aura/desktop_window_tree_host.h" | 41 #include "ui/views/widget/desktop_aura/desktop_window_tree_host.h" |
| 40 #include "ui/views/widget/drop_helper.h" | 42 #include "ui/views/widget/drop_helper.h" |
| 41 #include "ui/views/widget/native_widget_aura.h" | 43 #include "ui/views/widget/native_widget_aura.h" |
| (...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 408 | 410 |
| 409 content_window_container_ = new aura::Window(NULL); | 411 content_window_container_ = new aura::Window(NULL); |
| 410 content_window_container_->Init(aura::WINDOW_LAYER_NOT_DRAWN); | 412 content_window_container_->Init(aura::WINDOW_LAYER_NOT_DRAWN); |
| 411 content_window_container_->Show(); | 413 content_window_container_->Show(); |
| 412 content_window_container_->AddChild(content_window_); | 414 content_window_container_->AddChild(content_window_); |
| 413 | 415 |
| 414 desktop_window_tree_host_ = params.desktop_window_tree_host ? | 416 desktop_window_tree_host_ = params.desktop_window_tree_host ? |
| 415 params.desktop_window_tree_host : | 417 params.desktop_window_tree_host : |
| 416 DesktopWindowTreeHost::Create(native_widget_delegate_, this); | 418 DesktopWindowTreeHost::Create(native_widget_delegate_, this); |
| 417 host_.reset(desktop_window_tree_host_->AsWindowTreeHost()); | 419 host_.reset(desktop_window_tree_host_->AsWindowTreeHost()); |
| 418 desktop_window_tree_host_->Init(content_window_, params); | 420 desktop_window_tree_host_->Init( |
| 421 content_window_, params, |
| 422 ViewsDelegate::views_delegate->GetContextFactory()); |
| 419 | 423 |
| 420 // Mark this window as Desktop root window. | 424 // Mark this window as Desktop root window. |
| 421 host_->window()->SetProperty(views::kDesktopRootWindow, true); | 425 host_->window()->SetProperty(views::kDesktopRootWindow, true); |
| 422 | 426 |
| 423 host_->InitHost(); | 427 host_->InitHost(); |
| 424 host_->window()->AddChild(content_window_container_); | 428 host_->window()->AddChild(content_window_container_); |
| 425 host_->window()->SetProperty(kDesktopNativeWidgetAuraKey, this); | 429 host_->window()->SetProperty(kDesktopNativeWidgetAuraKey, this); |
| 426 | 430 |
| 427 host_->window()->AddObserver(new RootWindowDestructionObserver(this)); | 431 host_->window()->AddObserver(new RootWindowDestructionObserver(this)); |
| 428 | 432 |
| (...skipping 776 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1205 if (cursor_reference_count_ == 0) { | 1209 if (cursor_reference_count_ == 0) { |
| 1206 // We are the last DesktopNativeWidgetAura instance, and we are responsible | 1210 // We are the last DesktopNativeWidgetAura instance, and we are responsible |
| 1207 // for cleaning up |cursor_manager_|. | 1211 // for cleaning up |cursor_manager_|. |
| 1208 delete cursor_manager_; | 1212 delete cursor_manager_; |
| 1209 native_cursor_manager_ = NULL; | 1213 native_cursor_manager_ = NULL; |
| 1210 cursor_manager_ = NULL; | 1214 cursor_manager_ = NULL; |
| 1211 } | 1215 } |
| 1212 } | 1216 } |
| 1213 | 1217 |
| 1214 } // namespace views | 1218 } // namespace views |
| OLD | NEW |