| 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.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 | 339 |
| 340 void Widget::Init(const InitParams& in_params) { | 340 void Widget::Init(const InitParams& in_params) { |
| 341 TRACE_EVENT0("views", "Widget::Init"); | 341 TRACE_EVENT0("views", "Widget::Init"); |
| 342 InitParams params = in_params; | 342 InitParams params = in_params; |
| 343 | 343 |
| 344 is_top_level_ = params.top_level || | 344 is_top_level_ = params.top_level || |
| 345 (!params.child && | 345 (!params.child && |
| 346 params.type != InitParams::TYPE_CONTROL && | 346 params.type != InitParams::TYPE_CONTROL && |
| 347 params.type != InitParams::TYPE_TOOLTIP); | 347 params.type != InitParams::TYPE_TOOLTIP); |
| 348 params.top_level = is_top_level_; | 348 params.top_level = is_top_level_; |
| 349 #if defined(OS_WIN) && defined(USE_AURA) |
| 350 // It'll need to be faded in if it's top level and not the main window. |
| 351 params.transparent = is_top_level_ && params.type != InitParams::TYPE_WINDOW; |
| 352 #endif |
| 349 | 353 |
| 350 if (ViewsDelegate::views_delegate) | 354 if (ViewsDelegate::views_delegate) |
| 351 ViewsDelegate::views_delegate->OnBeforeWidgetInit(¶ms, this); | 355 ViewsDelegate::views_delegate->OnBeforeWidgetInit(¶ms, this); |
| 352 | 356 |
| 353 widget_delegate_ = params.delegate ? | 357 widget_delegate_ = params.delegate ? |
| 354 params.delegate : new DefaultWidgetDelegate(this, params); | 358 params.delegate : new DefaultWidgetDelegate(this, params); |
| 355 ownership_ = params.ownership; | 359 ownership_ = params.ownership; |
| 356 native_widget_ = CreateNativeWidget(params.native_widget, this)-> | 360 native_widget_ = CreateNativeWidget(params.native_widget, this)-> |
| 357 AsNativeWidgetPrivate(); | 361 AsNativeWidgetPrivate(); |
| 358 root_view_.reset(CreateRootView()); | 362 root_view_.reset(CreateRootView()); |
| (...skipping 1062 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1421 | 1425 |
| 1422 //////////////////////////////////////////////////////////////////////////////// | 1426 //////////////////////////////////////////////////////////////////////////////// |
| 1423 // internal::NativeWidgetPrivate, NativeWidget implementation: | 1427 // internal::NativeWidgetPrivate, NativeWidget implementation: |
| 1424 | 1428 |
| 1425 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { | 1429 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { |
| 1426 return this; | 1430 return this; |
| 1427 } | 1431 } |
| 1428 | 1432 |
| 1429 } // namespace internal | 1433 } // namespace internal |
| 1430 } // namespace views | 1434 } // namespace views |
| OLD | NEW |