Index: views/widget/native_widget_aura.cc |
diff --git a/views/widget/native_widget_aura.cc b/views/widget/native_widget_aura.cc |
index 7d014ad301599cb2db0d1634a5f855c040c5b6f9..72b94b6a91e5ebd85b5feb8143a927c1695ed59b 100644 |
--- a/views/widget/native_widget_aura.cc |
+++ b/views/widget/native_widget_aura.cc |
@@ -335,7 +335,7 @@ void NativeWidgetAura::EnableClose(bool enable) { |
} |
void NativeWidgetAura::Show() { |
- window_->Show(); |
+ ShowWithWindowState(ui::SHOW_STATE_INACTIVE); |
} |
void NativeWidgetAura::Hide() { |
@@ -345,12 +345,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; |
@@ -361,6 +360,9 @@ void NativeWidgetAura::ShowWithWindowState(ui::WindowShowState state) { |
break; |
} |
window_->Show(); |
+ if (can_activate_ && (state != ui::SHOW_STATE_INACTIVE || |
+ !GetWidget()->SetInitialFocus())) |
+ window_->Activate(); |
} |
bool NativeWidgetAura::IsVisible() const { |