| 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/native_widget_aura.h" | 5 #include "ui/views/widget/native_widget_aura.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
| 9 #include "ui/aura/client/activation_client.h" | 9 #include "ui/aura/client/activation_client.h" |
| 10 #include "ui/aura/client/aura_constants.h" | 10 #include "ui/aura/client/aura_constants.h" |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 // NativeWidgetAura, internal::NativeWidgetPrivate implementation: | 159 // NativeWidgetAura, internal::NativeWidgetPrivate implementation: |
| 160 | 160 |
| 161 void NativeWidgetAura::InitNativeWidget(const Widget::InitParams& params) { | 161 void NativeWidgetAura::InitNativeWidget(const Widget::InitParams& params) { |
| 162 ownership_ = params.ownership; | 162 ownership_ = params.ownership; |
| 163 window_->set_user_data(this); | 163 window_->set_user_data(this); |
| 164 Widget::InitParams::Type window_type = | 164 Widget::InitParams::Type window_type = |
| 165 params.child ? Widget::InitParams::TYPE_CONTROL : params.type; | 165 params.child ? Widget::InitParams::TYPE_CONTROL : params.type; |
| 166 window_->SetType(GetAuraWindowTypeForWidgetType(window_type)); | 166 window_->SetType(GetAuraWindowTypeForWidgetType(window_type)); |
| 167 // TODO(jamescook): Should this use params.show_state instead? | 167 // TODO(jamescook): Should this use params.show_state instead? |
| 168 window_->SetIntProperty(aura::client::kShowStateKey, ui::SHOW_STATE_NORMAL); | 168 window_->SetIntProperty(aura::client::kShowStateKey, ui::SHOW_STATE_NORMAL); |
| 169 window_->SetTransparent(params.transparent); |
| 169 window_->Init(params.create_texture_for_layer ? | 170 window_->Init(params.create_texture_for_layer ? |
| 170 ui::Layer::LAYER_HAS_TEXTURE : | 171 ui::Layer::LAYER_HAS_TEXTURE : |
| 171 ui::Layer::LAYER_HAS_NO_TEXTURE); | 172 ui::Layer::LAYER_HAS_NO_TEXTURE); |
| 172 if (window_type == Widget::InitParams::TYPE_CONTROL) | 173 if (window_type == Widget::InitParams::TYPE_CONTROL) |
| 173 window_->Show(); | 174 window_->Show(); |
| 174 | 175 |
| 175 window_->layer()->SetFillsBoundsOpaquely(!params.transparent); | |
| 176 delegate_->OnNativeWidgetCreated(); | 176 delegate_->OnNativeWidgetCreated(); |
| 177 window_->SetBounds(params.bounds); | 177 window_->SetBounds(params.bounds); |
| 178 if (window_type == Widget::InitParams::TYPE_CONTROL) { | 178 if (window_type == Widget::InitParams::TYPE_CONTROL) { |
| 179 window_->SetParent(params.GetParent()); | 179 window_->SetParent(params.GetParent()); |
| 180 } else { | 180 } else { |
| 181 // Set up the transient child before the window is added. This way the | 181 // Set up the transient child before the window is added. This way the |
| 182 // LayoutManager knows the window has a transient parent. | 182 // LayoutManager knows the window has a transient parent. |
| 183 gfx::NativeView parent = params.GetParent(); | 183 gfx::NativeView parent = params.GetParent(); |
| 184 if (parent && parent->type() != aura::client::WINDOW_TYPE_UNKNOWN) { | 184 if (parent && parent->type() != aura::client::WINDOW_TYPE_UNKNOWN) { |
| 185 parent->AddTransientChild(window_); | 185 parent->AddTransientChild(window_); |
| (...skipping 690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 876 } | 876 } |
| 877 } | 877 } |
| 878 | 878 |
| 879 // static | 879 // static |
| 880 bool NativeWidgetPrivate::IsMouseButtonDown() { | 880 bool NativeWidgetPrivate::IsMouseButtonDown() { |
| 881 return aura::RootWindow::GetInstance()->IsMouseButtonDown(); | 881 return aura::RootWindow::GetInstance()->IsMouseButtonDown(); |
| 882 } | 882 } |
| 883 | 883 |
| 884 } // namespace internal | 884 } // namespace internal |
| 885 } // namespace views | 885 } // namespace views |
| OLD | NEW |