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

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

Issue 10826085: Fixing problems with constrained windows (i.e. print preview) (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 5 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
Index: chrome/browser/ui/views/constrained_window_views.cc
diff --git a/chrome/browser/ui/views/constrained_window_views.cc b/chrome/browser/ui/views/constrained_window_views.cc
index 99cf0227cd89ae75764e5932cb4f87ed4444c81d..9b9717e2f041561910b7b57573ca54e52bc7022e 100644
--- a/chrome/browser/ui/views/constrained_window_views.cc
+++ b/chrome/browser/ui/views/constrained_window_views.cc
@@ -26,6 +26,7 @@
#include "grit/theme_resources.h"
#include "grit/ui_resources.h"
#include "net/base/net_util.h"
+#include "ui/aura/client/aura_constants.h"
#include "ui/base/hit_test.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/canvas.h"
@@ -586,6 +587,12 @@ ConstrainedWindowViews::ConstrainedWindowViews(
// Ash window headers can be transparent.
params.transparent = true;
ash::SetChildWindowVisibilityChangesAnimated(params.parent);
+ // No animations should get performed on the window since that will re-order
+ // the window stack which will then cause many problems.
+ if (params.parent && params.parent->parent()) {
+ params.parent->parent()->SetProperty(aura::client::kAnimationsDisabledKey,
+ true);
+ }
#endif
Init(params);
@@ -608,6 +615,12 @@ void ConstrainedWindowViews::ShowConstrainedWindow() {
}
void ConstrainedWindowViews::CloseConstrainedWindow() {
+#if defined(USE_ASH)
+ gfx::NativeView view = tab_contents_->web_contents()->GetNativeView();
+ // Allow the parent to animate again.
+ if (view && view->parent())
+ view->parent()->ClearProperty(aura::client::kAnimationsDisabledKey);
+#endif
tab_contents_->constrained_window_tab_helper()->WillClose(this);
Close();
}
@@ -664,3 +677,8 @@ views::internal::NativeWidgetDelegate*
ConstrainedWindowViews::AsNativeWidgetDelegate() {
return this;
}
+
+int ConstrainedWindowViews::GetNonClientComponent(const gfx::Point& point) {
+ // Prevent a constrained window to be moved by the user.
+ return HTNOWHERE;
+}
« ash/wm/frame_painter.cc ('K') | « chrome/browser/ui/views/constrained_window_views.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698