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_cursor_manager.h" | 5 #include "ui/views/widget/desktop_aura/desktop_native_cursor_manager.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "ui/aura/window_event_dispatcher.h" | 9 #include "ui/aura/window_event_dispatcher.h" |
10 #include "ui/aura/window_tree_host.h" | 10 #include "ui/aura/window_tree_host.h" |
11 #include "ui/base/cursor/cursor_loader.h" | 11 #include "ui/base/cursor/cursor_loader.h" |
12 #include "ui/views/widget/desktop_aura/desktop_cursor_loader_updater.h" | 12 #include "ui/views/widget/desktop_aura/desktop_cursor_loader_updater.h" |
13 | 13 |
14 namespace views { | 14 namespace views { |
15 | 15 |
16 DesktopNativeCursorManager::DesktopNativeCursorManager( | 16 DesktopNativeCursorManager::DesktopNativeCursorManager( |
17 scoped_ptr<DesktopCursorLoaderUpdater> cursor_loader_updater) | 17 std::unique_ptr<DesktopCursorLoaderUpdater> cursor_loader_updater) |
18 : cursor_loader_updater_(std::move(cursor_loader_updater)), | 18 : cursor_loader_updater_(std::move(cursor_loader_updater)), |
19 cursor_loader_(ui::CursorLoader::Create()) { | 19 cursor_loader_(ui::CursorLoader::Create()) { |
20 if (cursor_loader_updater_.get()) | 20 if (cursor_loader_updater_.get()) |
21 cursor_loader_updater_->OnCreate(1.0f, cursor_loader_.get()); | 21 cursor_loader_updater_->OnCreate(1.0f, cursor_loader_.get()); |
22 } | 22 } |
23 | 23 |
24 DesktopNativeCursorManager::~DesktopNativeCursorManager() { | 24 DesktopNativeCursorManager::~DesktopNativeCursorManager() { |
25 } | 25 } |
26 | 26 |
27 gfx::NativeCursor DesktopNativeCursorManager::GetInitializedCursor(int type) { | 27 gfx::NativeCursor DesktopNativeCursorManager::GetInitializedCursor(int type) { |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 // TODO(erg): In the ash version, we set the last mouse location on Env. I'm | 96 // TODO(erg): In the ash version, we set the last mouse location on Env. I'm |
97 // not sure this concept makes sense on the desktop. | 97 // not sure this concept makes sense on the desktop. |
98 | 98 |
99 SetVisibility(delegate->IsCursorVisible(), delegate); | 99 SetVisibility(delegate->IsCursorVisible(), delegate); |
100 | 100 |
101 for (Hosts::const_iterator i = hosts_.begin(); i != hosts_.end(); ++i) | 101 for (Hosts::const_iterator i = hosts_.begin(); i != hosts_.end(); ++i) |
102 (*i)->dispatcher()->OnMouseEventsEnableStateChanged(enabled); | 102 (*i)->dispatcher()->OnMouseEventsEnableStateChanged(enabled); |
103 } | 103 } |
104 | 104 |
105 } // namespace views | 105 } // namespace views |
OLD | NEW |