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
3 // found in the LICENSE file.
5 #include "ui/views/test/desktop_test_views_delegate.h"
7 #include "ui/views/widget/native_widget_mac.h"
11 DesktopTestViewsDelegate::DesktopTestViewsDelegate() {}
13 DesktopTestViewsDelegate::~DesktopTestViewsDelegate() {}
15 void DesktopTestViewsDelegate::OnBeforeWidgetInit(
16 Widget::InitParams* params,
17 internal::NativeWidgetDelegate* delegate) {
18 // If we already have a native_widget, we don't have to try to come
20 if (params->native_widget)
23 if (params->parent && params->type != views::Widget::InitParams::TYPE_MENU) {
24 params->native_widget = new NativeWidgetMac(delegate);
25 } else if (!params->parent && !params->context) {
27 // TODO(tapted): Implement DesktopNativeWidgetAura.
28 params->native_widget = new NativeWidgetMac(delegate);