diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-27 16:03:48 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-27 16:03:48 +0000 |
commit | ddd91e99989b2aa7539516f673f746f088cc607c (patch) | |
tree | 3f32d988f46f677e504b8fe42829cfce80962da7 /ui/views | |
parent | 92c0ca8e8f3873d7cbd8b72d751ba0106486c7dc (diff) | |
download | chromium_src-ddd91e99989b2aa7539516f673f746f088cc607c.zip chromium_src-ddd91e99989b2aa7539516f673f746f088cc607c.tar.gz chromium_src-ddd91e99989b2aa7539516f673f746f088cc607c.tar.bz2 |
Allow hide animations to work again:
- Introduces VisibilityClient, which aura::Window defers to to update layer visibility, if present. This replaces code which previously undid layer visibility changes after they were set. Layer visibility changes are potentially destructiver (they can drop textures associated with the layer and require a repaint).
- Implements this in ash in VisibilityController, which animates the visibility changes of children in annotated parents.
- Annotates various windows as requiring child window visibility change animations. This replaces animating visibility changes in LayoutManagers.
- Adds a second layer of visibility determination to aura::Window. Some code may check Window->IsVisible which was simply testing layer visibility. We want Window->IsVisible to return false as soon as Window::Hide() is called, so we add a member for this.
- We prevent stacking changes to the window from being propagated to the layer if the layer's delegate has been detached (i.e. the layer is hiding)
BUG=none
TEST=none
Review URL: https://chromiumcodereview.appspot.com/9235016
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@119453 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/views')
-rw-r--r-- | ui/views/widget/native_widget_aura.cc | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/ui/views/widget/native_widget_aura.cc b/ui/views/widget/native_widget_aura.cc index 487d706..57026ea 100644 --- a/ui/views/widget/native_widget_aura.cc +++ b/ui/views/widget/native_widget_aura.cc @@ -161,21 +161,19 @@ gfx::Font NativeWidgetAura::GetWindowTitleFont() { void NativeWidgetAura::InitNativeWidget(const Widget::InitParams& params) { ownership_ = params.ownership; window_->set_user_data(this); - Widget::InitParams::Type window_type = - params.child ? Widget::InitParams::TYPE_CONTROL : params.type; - window_->SetType(GetAuraWindowTypeForWidgetType(window_type)); + window_->SetType(GetAuraWindowTypeForWidgetType(params.type)); // TODO(jamescook): Should this use params.show_state instead? window_->SetIntProperty(aura::client::kShowStateKey, ui::SHOW_STATE_NORMAL); window_->SetTransparent(params.transparent); window_->Init(params.create_texture_for_layer ? ui::Layer::LAYER_HAS_TEXTURE : ui::Layer::LAYER_HAS_NO_TEXTURE); - if (window_type == Widget::InitParams::TYPE_CONTROL) + if (params.type == Widget::InitParams::TYPE_CONTROL) window_->Show(); delegate_->OnNativeWidgetCreated(); window_->SetBounds(params.bounds); - if (window_type == Widget::InitParams::TYPE_CONTROL) { + if (params.child) { window_->SetParent(params.GetParent()); } else { // Set up the transient child before the window is added. This way the @@ -195,9 +193,8 @@ void NativeWidgetAura::InitNativeWidget(const Widget::InitParams& params) { can_activate_ = params.can_activate; DCHECK(GetWidget()->GetRootView()); #if !defined(OS_MACOSX) - if (params.type != Widget::InitParams::TYPE_TOOLTIP) { + if (params.type != Widget::InitParams::TYPE_TOOLTIP) tooltip_manager_.reset(new views::TooltipManagerAura(this)); - } #endif // !defined(OS_MACOSX) drop_helper_.reset(new DropHelper(GetWidget()->GetRootView())); @@ -699,11 +696,7 @@ void NativeWidgetAura::OnCaptureLost() { } void NativeWidgetAura::OnPaint(gfx::Canvas* canvas) { - // Because we may animate closed it's entirely possible to be asked to paint - // while closing. We ignore paints during this time as most likely the data - // associated with views is in a weird state. - if (!close_widget_factory_.HasWeakPtrs()) - delegate_->OnNativeWidgetPaint(canvas); + delegate_->OnNativeWidgetPaint(canvas); } void NativeWidgetAura::OnWindowDestroying() { |