Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(143)

Unified Diff: ui/views/test/native_widget_factory_aura_mus.cc

Issue 2488393003: Changes views_aura_mus_unittests to create DesktopNativeWidgetAura (Closed)
Patch Set: remove this and fix mac Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/test/native_widget_factory.cc ('k') | ui/views/test/native_widget_factory_desktop.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « ui/views/test/native_widget_factory.cc ('k') | ui/views/test/native_widget_factory_desktop.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698