Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(21)

Side by Side Diff: views/widget/native_widget_test_utils_win.cc

Issue 7015051: Re-land: (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « views/widget/native_widget_test_utils_gtk.cc ('k') | views/widget/tooltip_manager_gtk.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "views/widget/native_widget_test_utils.h" 5 #include "views/widget/native_widget_test_utils.h"
6 6
7 #include "views/view.h" 7 #include "views/view.h"
8 #include "views/widget/widget_win.h" 8 #include "views/widget/widget_win.h"
9 9
10 namespace views { 10 namespace views {
11 namespace internal { 11 namespace internal {
12 12
13 NativeWidget* CreateNativeWidget() { 13 NativeWidget* CreateNativeWidget() {
14 return CreateNativeWidgetWithContents(new View); 14 return CreateNativeWidgetWithContents(new View);
15 } 15 }
16 16
17 NativeWidget* CreateNativeWidgetWithContents(View* contents_view) { 17 NativeWidget* CreateNativeWidgetWithContents(View* contents_view) {
18 Widget* widget = Widget::CreateWidget(); 18 Widget* widget = new Widget;
19 Widget::InitParams params(Widget::InitParams::TYPE_WINDOW); 19 Widget::InitParams params(Widget::InitParams::TYPE_WINDOW);
20 params.delete_on_destroy = false; 20 params.delete_on_destroy = false;
21 params.bounds = gfx::Rect(10, 10, 200, 200); 21 params.bounds = gfx::Rect(10, 10, 200, 200);
22 widget->Init(params); 22 widget->Init(params);
23 return widget->native_widget(); 23 return widget->native_widget();
24 } 24 }
25 25
26 NativeWidget* CreateNativeWidgetWithParent(NativeWidget* parent) { 26 NativeWidget* CreateNativeWidgetWithParent(NativeWidget* parent) {
27 Widget* widget = Widget::CreateWidget(); 27 Widget* widget = new Widget;
28 Widget::InitParams params(Widget::InitParams::TYPE_CONTROL); 28 Widget::InitParams params(Widget::InitParams::TYPE_CONTROL);
29 params.delete_on_destroy = false; 29 params.delete_on_destroy = false;
30 params.child = false; // Implicitly set to true by ctor with TYPE_CONTROL. 30 params.child = false; // Implicitly set to true by ctor with TYPE_CONTROL.
31 params.parent = parent ? parent->GetWidget()->GetNativeView() : NULL; 31 params.parent = parent ? parent->GetWidget()->GetNativeView() : NULL;
32 params.bounds = gfx::Rect(10, 10, 200, 200); 32 params.bounds = gfx::Rect(10, 10, 200, 200);
33 widget->Init(params); 33 widget->Init(params);
34 return widget->native_widget(); 34 return widget->native_widget();
35 } 35 }
36 36
37 } // namespace internal 37 } // namespace internal
38 } // namespace ui 38 } // namespace ui
OLDNEW
« no previous file with comments | « views/widget/native_widget_test_utils_gtk.cc ('k') | views/widget/tooltip_manager_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698