Chromium Code Reviews| Index: chrome/browser/ui/views/web_contents_modal_dialog_manager_views.cc |
| diff --git a/chrome/browser/ui/views/web_contents_modal_dialog_manager_views.cc b/chrome/browser/ui/views/web_contents_modal_dialog_manager_views.cc |
| index 2a6bd27d904289391fddae26df32509845df8860..c77ee1f7426f40124de38d92e0d57d0289a36259 100644 |
| --- a/chrome/browser/ui/views/web_contents_modal_dialog_manager_views.cc |
| +++ b/chrome/browser/ui/views/web_contents_modal_dialog_manager_views.cc |
| @@ -77,11 +77,9 @@ class NativeWebContentsModalDialogManagerViews |
| widget->GetNativeWindow()->SetProperty(aura::client::kConstrainedWindowKey, |
| true); |
| - if (views::DialogDelegate::UseNewStyle()) { |
| - views::corewm::SetWindowVisibilityAnimationType( |
| - widget->GetNativeWindow(), |
| - views::corewm::WINDOW_VISIBILITY_ANIMATION_TYPE_ROTATE); |
| - } |
| + views::corewm::SetWindowVisibilityAnimationType( |
| + widget->GetNativeWindow(), |
| + views::corewm::WINDOW_VISIBILITY_ANIMATION_TYPE_ROTATE); |
| #endif |
| #if defined(USE_ASH) |
| @@ -105,8 +103,7 @@ class NativeWebContentsModalDialogManagerViews |
| views::Widget* widget = GetWidget(dialog); |
| #if defined(USE_AURA) |
| scoped_ptr<views::corewm::SuspendChildWindowVisibilityAnimations> suspend; |
| - if (views::DialogDelegate::UseNewStyle() && |
| - shown_widgets_.find(widget) != shown_widgets_.end()) { |
| + if (shown_widgets_.find(widget) != shown_widgets_.end()) { |
| suspend.reset(new views::corewm::SuspendChildWindowVisibilityAnimations( |
| widget->GetNativeWindow()->parent())); |
| } |
| @@ -129,10 +126,8 @@ class NativeWebContentsModalDialogManagerViews |
| views::Widget* widget = GetWidget(dialog); |
| #if defined(USE_AURA) |
| scoped_ptr<views::corewm::SuspendChildWindowVisibilityAnimations> suspend; |
| - if (views::DialogDelegate::UseNewStyle()) { |
| - suspend.reset(new views::corewm::SuspendChildWindowVisibilityAnimations( |
| - widget->GetNativeWindow()->parent())); |
| - } |
| + suspend.reset(new views::corewm::SuspendChildWindowVisibilityAnimations( |
| + widget->GetNativeWindow()->parent())); |
| #endif |
| widget->Hide(); |
| } |
| @@ -197,16 +192,12 @@ class NativeWebContentsModalDialogManagerViews |
| host_ = new_host; |
| - if (host_) |
| + // |host_| may be null during WebContents destruction or Win32 tab dragging. |
| + if (host_) { |
| host_->AddObserver(this); |
| - // Old-style dialogs are parented to the web contents view and don't need |
| - // reparenting. The host_ may be null during tab drag under Views/Win32 or |
| - // when destroying the WebContents. |
| - if (views::DialogDelegate::UseNewStyle() && host_) { |
| - for (std::set<views::Widget*>::iterator it = observed_widgets_.begin(); |
| - it != observed_widgets_.end(); |
| - ++it) { |
| + std::set<views::Widget*>::iterator it = observed_widgets_.begin(); |
|
sky
2013/11/16 03:03:16
move inside lop.
msw
2013/11/16 04:15:44
Done.
|
| + for (; it != observed_widgets_.end(); ++it) { |
| views::Widget::ReparentNativeView((*it)->GetNativeView(), |
| host_->GetHostView()); |
| } |