OLD | NEW |
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_aura.h" | 5 #include "views/widget/native_widget_aura.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "ui/aura/desktop.h" | 8 #include "ui/aura/desktop.h" |
9 #include "ui/aura/event.h" | 9 #include "ui/aura/event.h" |
10 #include "ui/aura/window.h" | 10 #include "ui/aura/window.h" |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 window_->Init(params.create_texture_for_layer ? | 79 window_->Init(params.create_texture_for_layer ? |
80 ui::Layer::LAYER_HAS_TEXTURE : ui::Layer::LAYER_HAS_NO_TEXTURE); | 80 ui::Layer::LAYER_HAS_TEXTURE : ui::Layer::LAYER_HAS_NO_TEXTURE); |
81 // TODO(beng): respect |params| authoritah wrt transparency. | 81 // TODO(beng): respect |params| authoritah wrt transparency. |
82 window_->layer()->SetFillsBoundsOpaquely(false); | 82 window_->layer()->SetFillsBoundsOpaquely(false); |
83 delegate_->OnNativeWidgetCreated(); | 83 delegate_->OnNativeWidgetCreated(); |
84 window_->set_minimum_size(delegate_->GetMinimumSize()); | 84 window_->set_minimum_size(delegate_->GetMinimumSize()); |
85 window_->SetBounds(params.bounds); | 85 window_->SetBounds(params.bounds); |
86 if (params.type == Widget::InitParams::TYPE_CONTROL) { | 86 if (params.type == Widget::InitParams::TYPE_CONTROL) { |
87 window_->SetParent(params.GetParent()); | 87 window_->SetParent(params.GetParent()); |
88 } else { | 88 } else { |
89 window_->SetParent(NULL); | 89 // Set up the transient child before the window is added. This way the |
| 90 // LayoutManager knows the window has a transient parent. |
90 gfx::NativeView parent = params.GetParent(); | 91 gfx::NativeView parent = params.GetParent(); |
91 if (parent) | 92 if (parent) |
92 parent->AddTransientChild(window_); | 93 parent->AddTransientChild(window_); |
| 94 window_->SetParent(NULL); |
93 } | 95 } |
94 // TODO(beng): do this some other way. | 96 // TODO(beng): do this some other way. |
95 delegate_->OnNativeWidgetSizeChanged(params.bounds.size()); | 97 delegate_->OnNativeWidgetSizeChanged(params.bounds.size()); |
96 can_activate_ = params.can_activate; | 98 can_activate_ = params.can_activate; |
97 if (params.type != Widget::InitParams::TYPE_TOOLTIP && !params.child) { | 99 if (params.type != Widget::InitParams::TYPE_TOOLTIP && !params.child) { |
98 DCHECK(GetWidget()->GetRootView()); | 100 DCHECK(GetWidget()->GetRootView()); |
99 views::TooltipManagerViews* manager = new views::TooltipManagerViews( | 101 views::TooltipManagerViews* manager = new views::TooltipManagerViews( |
100 GetWidget()->GetRootView()); | 102 GetWidget()->GetRootView()); |
101 tooltip_manager_.reset(manager); | 103 tooltip_manager_.reset(manager); |
102 } | 104 } |
(...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
642 } | 644 } |
643 | 645 |
644 // static | 646 // static |
645 bool NativeWidgetPrivate::IsMouseButtonDown() { | 647 bool NativeWidgetPrivate::IsMouseButtonDown() { |
646 NOTIMPLEMENTED(); | 648 NOTIMPLEMENTED(); |
647 return false; | 649 return false; |
648 } | 650 } |
649 | 651 |
650 } // namespace internal | 652 } // namespace internal |
651 } // namespace views | 653 } // namespace views |
OLD | NEW |