OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/test/native_widget_factory.h" | 5 #include "ui/views/test/native_widget_factory.h" |
6 | 6 |
7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
8 #include "ui/views/mus/desktop_window_tree_host_mus.h" | 8 #include "ui/views/mus/desktop_window_tree_host_mus.h" |
9 #include "ui/views/mus/mus_client.h" | 9 #include "ui/views/mus/mus_client.h" |
10 #include "ui/views/test/test_platform_native_widget.h" | 10 #include "ui/views/test/test_platform_native_widget.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 return new TestPlatformNativeWidget<NativeWidgetAura>( | 25 return new TestPlatformNativeWidget<NativeWidgetAura>( |
26 widget, type == kStubCapture, destroyed); | 26 widget, type == kStubCapture, destroyed); |
27 } | 27 } |
28 DesktopNativeWidgetAura* desktop_native_widget_aura = | 28 DesktopNativeWidgetAura* desktop_native_widget_aura = |
29 new TestPlatformNativeWidget<DesktopNativeWidgetAura>( | 29 new TestPlatformNativeWidget<DesktopNativeWidgetAura>( |
30 widget, type == kStubCapture, destroyed); | 30 widget, type == kStubCapture, destroyed); |
31 std::map<std::string, std::vector<uint8_t>> mus_properties = | 31 std::map<std::string, std::vector<uint8_t>> mus_properties = |
32 MusClient::Get()->ConfigurePropertiesFromParams(init_params); | 32 MusClient::Get()->ConfigurePropertiesFromParams(init_params); |
33 desktop_native_widget_aura->SetDesktopWindowTreeHost( | 33 desktop_native_widget_aura->SetDesktopWindowTreeHost( |
34 base::MakeUnique<DesktopWindowTreeHostMus>( | 34 base::MakeUnique<DesktopWindowTreeHostMus>( |
35 widget, desktop_native_widget_aura, &mus_properties)); | 35 widget, desktop_native_widget_aura, cc::FrameSinkId(), |
| 36 &mus_properties)); |
36 return desktop_native_widget_aura; | 37 return desktop_native_widget_aura; |
37 } | 38 } |
38 | 39 |
39 } // namespace | 40 } // namespace |
40 | 41 |
41 NativeWidget* CreatePlatformNativeWidgetImpl( | 42 NativeWidget* CreatePlatformNativeWidgetImpl( |
42 const Widget::InitParams& init_params, | 43 const Widget::InitParams& init_params, |
43 Widget* widget, | 44 Widget* widget, |
44 uint32_t type, | 45 uint32_t type, |
45 bool* destroyed) { | 46 bool* destroyed) { |
46 // Only create a NativeWidgetAura if necessary, otherwise use | 47 // Only create a NativeWidgetAura if necessary, otherwise use |
47 // DesktopNativeWidgetAura. | 48 // DesktopNativeWidgetAura. |
48 return CreatePlatformNativeWidgetImplAuraMus( | 49 return CreatePlatformNativeWidgetImplAuraMus( |
49 MusClient::ShouldCreateDesktopNativeWidgetAura(init_params), init_params, | 50 MusClient::ShouldCreateDesktopNativeWidgetAura(init_params), init_params, |
50 widget, type, destroyed); | 51 widget, type, destroyed); |
51 } | 52 } |
52 | 53 |
53 NativeWidget* CreatePlatformDesktopNativeWidgetImpl( | 54 NativeWidget* CreatePlatformDesktopNativeWidgetImpl( |
54 const Widget::InitParams& init_params, | 55 const Widget::InitParams& init_params, |
55 Widget* widget, | 56 Widget* widget, |
56 bool* destroyed) { | 57 bool* destroyed) { |
57 return CreatePlatformNativeWidgetImplAuraMus(true, init_params, widget, | 58 return CreatePlatformNativeWidgetImplAuraMus(true, init_params, widget, |
58 kDefault, destroyed); | 59 kDefault, destroyed); |
59 } | 60 } |
60 | 61 |
61 } // namespace test | 62 } // namespace test |
62 } // namespace views | 63 } // namespace views |
OLD | NEW |