Chromium Code Reviews| Index: views/widget/native_widget_aura.cc |
| diff --git a/views/widget/native_widget_aura.cc b/views/widget/native_widget_aura.cc |
| index a9c88e7adb53c7a9ed4b46ac55e922f7adda0ab3..dcf0323c3adfe1acb5c6f4c8758f75f561db13e8 100644 |
| --- a/views/widget/native_widget_aura.cc |
| +++ b/views/widget/native_widget_aura.cc |
| @@ -86,10 +86,10 @@ void NativeWidgetAura::InitNativeWidget(const Widget::InitParams& params) { |
| if (params.type == Widget::InitParams::TYPE_CONTROL) { |
| window_->SetParent(params.GetParent()); |
| } else { |
| - window_->SetParent(NULL); |
| gfx::NativeView parent = params.GetParent(); |
| if (parent) |
| parent->AddTransientChild(window_); |
| + window_->SetParent(NULL); |
| } |
| // TODO(beng): do this some other way. |
| delegate_->OnNativeWidgetSizeChanged(params.bounds.size()); |
| @@ -310,7 +310,7 @@ void NativeWidgetAura::EnableClose(bool enable) { |
| } |
| void NativeWidgetAura::Show() { |
| - window_->Show(); |
| + ShowWithWindowState(ui::SHOW_STATE_INACTIVE); |
| } |
| void NativeWidgetAura::Hide() { |
| @@ -320,12 +320,11 @@ void NativeWidgetAura::Hide() { |
| void NativeWidgetAura::ShowMaximizedWithBounds( |
| const gfx::Rect& restored_bounds) { |
| window_->SetBounds(restored_bounds); |
| - window_->Maximize(); |
| - window_->Show(); |
| + ShowWithWindowState(ui::SHOW_STATE_MAXIMIZED); |
| } |
| void NativeWidgetAura::ShowWithWindowState(ui::WindowShowState state) { |
| - switch(state) { |
| + switch (state) { |
| case ui::SHOW_STATE_MAXIMIZED: |
| window_->Maximize(); |
| break; |
| @@ -336,6 +335,9 @@ void NativeWidgetAura::ShowWithWindowState(ui::WindowShowState state) { |
| break; |
| } |
| window_->Show(); |
| + if (can_activate_ && (state != ui::SHOW_STATE_INACTIVE || |
| + !GetWidget()->SetInitialFocus())) |
| + window_->Activate(); |
|
Ben Goodger (Google)
2011/10/31 18:31:39
braces around this block
|
| } |
| bool NativeWidgetAura::IsVisible() const { |
| @@ -388,6 +390,7 @@ bool NativeWidgetAura::IsFullscreen() const { |
| void NativeWidgetAura::SetOpacity(unsigned char opacity) { |
| window_->layer()->SetOpacity(opacity / 255.0); |
| + window_->layer()->ScheduleDraw(); |
| } |
| void NativeWidgetAura::SetUseDragFrame(bool use_drag_frame) { |