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/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 return type == InitParams::TYPE_WINDOW || | 323 return type == InitParams::TYPE_WINDOW || |
324 type == InitParams::TYPE_PANEL || | 324 type == InitParams::TYPE_PANEL || |
325 type == InitParams::TYPE_BUBBLE; | 325 type == InitParams::TYPE_BUBBLE; |
326 } | 326 } |
327 | 327 |
328 void Widget::Init(const InitParams& in_params) { | 328 void Widget::Init(const InitParams& in_params) { |
329 TRACE_EVENT0("views", "Widget::Init"); | 329 TRACE_EVENT0("views", "Widget::Init"); |
330 InitParams params = in_params; | 330 InitParams params = in_params; |
331 | 331 |
332 params.child |= (params.type == InitParams::TYPE_CONTROL); | 332 params.child |= (params.type == InitParams::TYPE_CONTROL); |
333 is_top_level_ = (!params.child && params.type != InitParams::TYPE_TOOLTIP); | 333 is_top_level_ = !params.child; |
334 | 334 |
335 if (params.opacity == views::Widget::InitParams::INFER_OPACITY && | 335 if (params.opacity == views::Widget::InitParams::INFER_OPACITY && |
336 params.type != views::Widget::InitParams::TYPE_WINDOW && | 336 params.type != views::Widget::InitParams::TYPE_WINDOW && |
337 params.type != views::Widget::InitParams::TYPE_PANEL) | 337 params.type != views::Widget::InitParams::TYPE_PANEL) |
338 params.opacity = views::Widget::InitParams::OPAQUE_WINDOW; | 338 params.opacity = views::Widget::InitParams::OPAQUE_WINDOW; |
339 | 339 |
340 if (ViewsDelegate::views_delegate) | 340 if (ViewsDelegate::views_delegate) |
341 ViewsDelegate::views_delegate->OnBeforeWidgetInit(¶ms, this); | 341 ViewsDelegate::views_delegate->OnBeforeWidgetInit(¶ms, this); |
342 | 342 |
343 if (params.opacity == views::Widget::InitParams::INFER_OPACITY) | 343 if (params.opacity == views::Widget::InitParams::INFER_OPACITY) |
(...skipping 1161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1505 | 1505 |
1506 //////////////////////////////////////////////////////////////////////////////// | 1506 //////////////////////////////////////////////////////////////////////////////// |
1507 // internal::NativeWidgetPrivate, NativeWidget implementation: | 1507 // internal::NativeWidgetPrivate, NativeWidget implementation: |
1508 | 1508 |
1509 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { | 1509 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { |
1510 return this; | 1510 return this; |
1511 } | 1511 } |
1512 | 1512 |
1513 } // namespace internal | 1513 } // namespace internal |
1514 } // namespace views | 1514 } // namespace views |
OLD | NEW |