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

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: 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 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) {
« 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