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.
4
5#include "ui/views/test/desktop_test_views_delegate.h"
6
7#include "ui/views/widget/native_widget_mac.h"
8
9namespace views {
10
11DesktopTestViewsDelegate::DesktopTestViewsDelegate() {}
12
13DesktopTestViewsDelegate::~DesktopTestViewsDelegate() {}
14
15void 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
19  // up with one.
20  if (params->native_widget)
21    return;
22
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) {
26    NOTIMPLEMENTED();
27    // TODO(tapted): Implement DesktopNativeWidgetAura.
28    params->native_widget = new NativeWidgetMac(delegate);
29  }
30}
31
32}  // namespace views
33