| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "services/ui/ws/platform_display.h" | 5 #include "services/ui/ws/platform_display.h" |
| 6 | 6 |
| 7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 #include "services/ui/ws/platform_display_default.h" | 8 #include "services/ui/ws/platform_display_default.h" |
| 9 #include "services/ui/ws/platform_display_factory.h" | 9 #include "services/ui/ws/platform_display_factory.h" |
| 10 #include "services/ui/ws/server_window.h" | 10 #include "services/ui/ws/server_window.h" |
| 11 #include "services/ui/ws/threaded_image_cursors.h" | 11 #include "services/ui/ws/threaded_image_cursors.h" |
| 12 | 12 |
| 13 namespace ui { | 13 namespace ui { |
| 14 namespace ws { | 14 namespace ws { |
| 15 | 15 |
| 16 // static | 16 // static |
| 17 PlatformDisplayFactory* PlatformDisplay::factory_ = nullptr; | 17 PlatformDisplayFactory* PlatformDisplay::factory_ = nullptr; |
| 18 | 18 |
| 19 // static | 19 // static |
| 20 std::unique_ptr<PlatformDisplay> PlatformDisplay::Create( | 20 std::unique_ptr<PlatformDisplay> PlatformDisplay::Create( |
| 21 ServerWindow* root, | 21 ServerWindow* root, |
| 22 const display::ViewportMetrics& metrics, | 22 const display::ViewportMetrics& metrics, |
| 23 scoped_refptr<base::SingleThreadTaskRunner>& resource_runner, | 23 scoped_refptr<base::SingleThreadTaskRunner>& resource_runner, |
| 24 base::WeakPtr<ui::ImageCursors> image_cursors_weak_ptr) { | 24 base::WeakPtr<ui::ImageCursorsHolder> image_cursors_holder_weak_ptr) { |
| 25 if (factory_) | 25 if (factory_) |
| 26 return factory_->CreatePlatformDisplay(root, metrics); | 26 return factory_->CreatePlatformDisplay(root, metrics); |
| 27 | 27 |
| 28 #if defined(OS_ANDROID) | 28 #if defined(OS_ANDROID) |
| 29 return base::MakeUnique<PlatformDisplayDefault>(root, metrics, | 29 return base::MakeUnique<PlatformDisplayDefault>(root, metrics, |
| 30 nullptr /* image_cursors */); | 30 nullptr /* image_cursors */); |
| 31 #else | 31 #else |
| 32 return base::MakeUnique<PlatformDisplayDefault>( | 32 return base::MakeUnique<PlatformDisplayDefault>( |
| 33 root, metrics, | 33 root, metrics, |
| 34 base::MakeUnique<ThreadedImageCursors>(resource_runner, | 34 base::MakeUnique<ThreadedImageCursors>(resource_runner, |
| 35 image_cursors_weak_ptr)); | 35 image_cursors_holder_weak_ptr)); |
| 36 #endif | 36 #endif |
| 37 } | 37 } |
| 38 | 38 |
| 39 } // namespace ws | 39 } // namespace ws |
| 40 } // namespace ui | 40 } // namespace ui |
| OLD | NEW |