Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / ui / views / test / desktop_test_views_delegate_mac.mm
blob0349d6f1cf4fefb46007d6e99031e3fc45023d55
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"
9 namespace views {
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
19   // up with one.
20   if (params->native_widget)
21     return;
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   }
32 }  // namespace views