| Index: ui/views/test/native_widget_factory_aura_mus.cc
|
| diff --git a/ui/views/test/native_widget_factory_aura_mus.cc b/ui/views/test/native_widget_factory_aura_mus.cc
|
| index 33b7a6163dbc9d031c0e8010e20a20d8a4133727..30a0d8fd4e4a1fc81224ba2558235bb8d1e8ff7c 100644
|
| --- a/ui/views/test/native_widget_factory_aura_mus.cc
|
| +++ b/ui/views/test/native_widget_factory_aura_mus.cc
|
| @@ -4,16 +4,56 @@
|
|
|
| #include "ui/views/test/native_widget_factory.h"
|
|
|
| +#include "base/memory/ptr_util.h"
|
| +#include "ui/views/mus/desktop_window_tree_host_mus.h"
|
| #include "ui/views/mus/mus_client.h"
|
| +#include "ui/views/test/test_platform_native_widget.h"
|
| +#include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h"
|
| +#include "ui/views/widget/native_widget_aura.h"
|
|
|
| namespace views {
|
| namespace test {
|
| +namespace {
|
| +
|
| +NativeWidget* CreatePlatformNativeWidgetImplAuraMus(
|
| + bool create_desktop_native_widget_aura,
|
| + const Widget::InitParams& init_params,
|
| + Widget* widget,
|
| + int32_t type,
|
| + bool* destroyed) {
|
| + if (!create_desktop_native_widget_aura) {
|
| + return new TestPlatformNativeWidget<NativeWidgetAura>(
|
| + widget, type == kStubCapture, destroyed);
|
| + }
|
| + DesktopNativeWidgetAura* desktop_native_widget_aura =
|
| + new TestPlatformNativeWidget<DesktopNativeWidgetAura>(
|
| + widget, type == kStubCapture, destroyed);
|
| + desktop_native_widget_aura->SetDesktopWindowTreeHost(
|
| + base::MakeUnique<DesktopWindowTreeHostMus>(widget,
|
| + desktop_native_widget_aura));
|
| + return desktop_native_widget_aura;
|
| +}
|
| +
|
| +} // namespace
|
| +
|
| +NativeWidget* CreatePlatformNativeWidgetImpl(
|
| + const Widget::InitParams& init_params,
|
| + Widget* widget,
|
| + uint32_t type,
|
| + bool* destroyed) {
|
| + // Only create a NativeWidgetAura if necessary, otherwise use
|
| + // DesktopNativeWidgetAura.
|
| + return CreatePlatformNativeWidgetImplAuraMus(
|
| + MusClient::ShouldCreateDesktopNativeWidgetAura(init_params), init_params,
|
| + widget, type, destroyed);
|
| +}
|
|
|
| NativeWidget* CreatePlatformDesktopNativeWidgetImpl(
|
| const Widget::InitParams& init_params,
|
| Widget* widget,
|
| bool* destroyed) {
|
| - return MusClient::Get()->CreateNativeWidget(init_params, widget);
|
| + return CreatePlatformNativeWidgetImplAuraMus(true, init_params, widget,
|
| + kDefault, destroyed);
|
| }
|
|
|
| } // namespace test
|
|
|