summaryrefslogtreecommitdiffstats
path: root/views/widget/native_widget_test_utils_win.cc
blob: 2d016e9ff6a0e6fb47ac26b6c86f3dba140b3d1f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "views/widget/native_widget_test_utils.h"

#include "views/view.h"
#include "views/widget/widget_win.h"

namespace views {
namespace internal {

NativeWidget* CreateNativeWidget() {
  return CreateNativeWidgetWithContents(new View);
}

NativeWidget* CreateNativeWidgetWithContents(View* contents_view) {
  WidgetWin* widget = new WidgetWin;
  widget->set_delete_on_destroy(false);
  widget->Init(NULL, gfx::Rect(10, 10, 200, 200));
  return widget;
}

NativeWidget* CreateNativeWidgetWithParent(NativeWidget* parent) {
  WidgetWin* widget = new WidgetWin;
  widget->set_delete_on_destroy(false);
  widget->Init(parent ? parent->GetWidget()->GetNativeView() : NULL,
               gfx::Rect(10, 10, 200, 200));
  return widget;
}

}  // namespace internal
}  // namespace ui