Fix build break
[chromium-blink-merge.git] / ui / views / widget / native_widget_test_utils_aura.cc
blobaf7cf59375f3061bf0a7d1b4f4f0b50664623330
1 // Copyright (c) 2011 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/widget/native_widget_test_utils.h"
7 #include "ui/views/view.h"
8 #include "ui/views/widget/native_widget_private.h"
9 #include "ui/views/widget/widget.h"
11 namespace views {
12 namespace internal {
14 namespace {
16 NativeWidgetPrivate* CreateNativeWidgetOfType(Widget::InitParams::Type type) {
17 Widget* widget = new Widget;
18 Widget::InitParams params(type);
19 params.ownership = views::Widget::InitParams::NATIVE_WIDGET_OWNS_WIDGET;
20 params.child = false; // Implicitly set to true by ctor with TYPE_CONTROL.
21 params.bounds = gfx::Rect(10, 10, 200, 200);
22 widget->Init(params);
23 return widget->native_widget_private();
26 } // namespace
28 NativeWidgetPrivate* CreateNativeWidget() {
29 return CreateNativeWidgetOfType(Widget::InitParams::TYPE_POPUP);
32 NativeWidgetPrivate* CreateNativeSubWidget() {
33 return CreateNativeWidgetOfType(Widget::InitParams::TYPE_CONTROL);
36 } // namespace internal
37 } // namespace ui