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

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: Addressed namespace request 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
« no previous file with comments | « chrome/browser/ui/views/constrained_window_views.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..18b4202822fad23a36b48ee883d5a327f82bc690 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"
@@ -49,6 +50,7 @@
#endif
#if defined(USE_ASH)
+#include "ash/ash_constants.h"
#include "ash/ash_switches.h"
#include "ash/shell.h"
#include "ash/wm/custom_frame_view_ash.h"
@@ -586,10 +588,19 @@ 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);
tab_contents_->constrained_window_tab_helper()->AddConstrainedDialog(this);
+#if defined(USE_ASH)
+ GetNativeWindow()->SetProperty(ash::kConstrainedWindowKey, true);
+#endif
}
ConstrainedWindowViews::~ConstrainedWindowViews() {
@@ -608,6 +619,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 +681,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;
+}
« no previous file with comments | « 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