Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(944)

Unified Diff: views/widget/native_widget_aura.cc

Issue 8432001: Tweaks whether Show activates the window or not. I'm pretty sure this (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to trunk Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « views/widget/native_widget_aura.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 {
« no previous file with comments | « views/widget/native_widget_aura.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698