| 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/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/trace_event/trace_event.h" | 9 #include "base/trace_event/trace_event.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 451 | 451 |
| 452 // The host's dispatcher must be added to |native_cursor_manager_| before | 452 // The host's dispatcher must be added to |native_cursor_manager_| before |
| 453 // OnNativeWidgetCreated() is called. | 453 // OnNativeWidgetCreated() is called. |
| 454 cursor_reference_count_++; | 454 cursor_reference_count_++; |
| 455 if (!native_cursor_manager_) { | 455 if (!native_cursor_manager_) { |
| 456 native_cursor_manager_ = new DesktopNativeCursorManager( | 456 native_cursor_manager_ = new DesktopNativeCursorManager( |
| 457 DesktopCursorLoaderUpdater::Create()); | 457 DesktopCursorLoaderUpdater::Create()); |
| 458 } | 458 } |
| 459 if (!cursor_manager_) { | 459 if (!cursor_manager_) { |
| 460 cursor_manager_ = new wm::CursorManager( | 460 cursor_manager_ = new wm::CursorManager( |
| 461 scoped_ptr<wm::NativeCursorManager>(native_cursor_manager_)); | 461 std::unique_ptr<wm::NativeCursorManager>(native_cursor_manager_)); |
| 462 } | 462 } |
| 463 native_cursor_manager_->AddHost(host()); | 463 native_cursor_manager_->AddHost(host()); |
| 464 aura::client::SetCursorClient(host_->window(), cursor_manager_); | 464 aura::client::SetCursorClient(host_->window(), cursor_manager_); |
| 465 | 465 |
| 466 desktop_window_tree_host_->OnNativeWidgetCreated(params); | 466 desktop_window_tree_host_->OnNativeWidgetCreated(params); |
| 467 | 467 |
| 468 UpdateWindowTransparency(); | 468 UpdateWindowTransparency(); |
| 469 | 469 |
| 470 capture_client_.reset(new DesktopCaptureClient(host_->window())); | 470 capture_client_.reset(new DesktopCaptureClient(host_->window())); |
| 471 | 471 |
| (...skipping 705 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1177 if (cursor_reference_count_ == 0) { | 1177 if (cursor_reference_count_ == 0) { |
| 1178 // We are the last DesktopNativeWidgetAura instance, and we are responsible | 1178 // We are the last DesktopNativeWidgetAura instance, and we are responsible |
| 1179 // for cleaning up |cursor_manager_|. | 1179 // for cleaning up |cursor_manager_|. |
| 1180 delete cursor_manager_; | 1180 delete cursor_manager_; |
| 1181 native_cursor_manager_ = NULL; | 1181 native_cursor_manager_ = NULL; |
| 1182 cursor_manager_ = NULL; | 1182 cursor_manager_ = NULL; |
| 1183 } | 1183 } |
| 1184 } | 1184 } |
| 1185 | 1185 |
| 1186 } // namespace views | 1186 } // namespace views |
| OLD | NEW |