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

Unified Diff: chrome/browser/ui/views/web_contents_modal_dialog_manager_views.cc

Issue 63343004: Remove DialogDelegate::UseNewStyle and unused code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Restore [D]CHECKs and loop scoping. Created 7 years, 1 month 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
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..46d8a9944bd3c4626c223395c2eb5c3cbd5bc016 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,13 +192,10 @@ 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) {

Powered by Google App Engine
This is Rietveld 408576698