OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ui/views/widget/widget.h" | 5 #include "ui/views/widget/widget.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "ui/base/events/event.h" | 10 #include "ui/base/events/event.h" |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 Widget* Widget::CreateWindow(WidgetDelegate* delegate) { | 223 Widget* Widget::CreateWindow(WidgetDelegate* delegate) { |
224 Widget* widget = new Widget; | 224 Widget* widget = new Widget; |
225 Widget::InitParams params; | 225 Widget::InitParams params; |
226 params.delegate = delegate; | 226 params.delegate = delegate; |
227 params.top_level = true; | 227 params.top_level = true; |
228 widget->Init(params); | 228 widget->Init(params); |
229 return widget; | 229 return widget; |
230 } | 230 } |
231 | 231 |
232 // static | 232 // static |
| 233 Widget* Widget::CreateWindowWithBounds(WidgetDelegate* delegate, |
| 234 const gfx::Rect& bounds) { |
| 235 return CreateWindowWithParentAndBounds(delegate, NULL, bounds); |
| 236 } |
| 237 |
| 238 // static |
233 Widget* Widget::CreateWindowWithParent(WidgetDelegate* delegate, | 239 Widget* Widget::CreateWindowWithParent(WidgetDelegate* delegate, |
234 gfx::NativeWindow parent) { | 240 gfx::NativeWindow parent) { |
235 return CreateWindowWithParentAndBounds(delegate, parent, gfx::Rect()); | 241 return CreateWindowWithParentAndBounds(delegate, parent, gfx::Rect()); |
236 } | 242 } |
237 | 243 |
238 // static | 244 // static |
239 Widget* Widget::CreateWindowWithBounds(WidgetDelegate* delegate, | |
240 const gfx::Rect& bounds) { | |
241 return CreateWindowWithParentAndBounds(delegate, NULL, bounds); | |
242 } | |
243 | |
244 // static | |
245 Widget* Widget::CreateWindowWithParentAndBounds(WidgetDelegate* delegate, | 245 Widget* Widget::CreateWindowWithParentAndBounds(WidgetDelegate* delegate, |
246 gfx::NativeWindow parent, | 246 gfx::NativeWindow parent, |
247 const gfx::Rect& bounds) { | 247 const gfx::Rect& bounds) { |
248 Widget* widget = new Widget; | 248 Widget* widget = new Widget; |
249 Widget::InitParams params; | 249 Widget::InitParams params; |
250 params.delegate = delegate; | 250 params.delegate = delegate; |
251 params.parent = parent; | 251 params.parent = parent; |
252 params.bounds = bounds; | 252 params.bounds = bounds; |
253 widget->Init(params); | 253 widget->Init(params); |
254 return widget; | 254 return widget; |
(...skipping 1133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1388 | 1388 |
1389 //////////////////////////////////////////////////////////////////////////////// | 1389 //////////////////////////////////////////////////////////////////////////////// |
1390 // internal::NativeWidgetPrivate, NativeWidget implementation: | 1390 // internal::NativeWidgetPrivate, NativeWidget implementation: |
1391 | 1391 |
1392 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { | 1392 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { |
1393 return this; | 1393 return this; |
1394 } | 1394 } |
1395 | 1395 |
1396 } // namespace internal | 1396 } // namespace internal |
1397 } // namespace views | 1397 } // namespace views |
OLD | NEW |