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

Unified Diff: ash/wm/workspace/workspace_window_resizer.cc

Issue 10837211: Draw web content area correctly on a phantom window for window dragging (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove WindowPainter Created 8 years, 4 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 | « ash/wm/workspace/workspace_window_resizer.h ('k') | ash/wm/workspace/workspace_window_resizer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/workspace/workspace_window_resizer.cc
diff --git a/ash/wm/workspace/workspace_window_resizer.cc b/ash/wm/workspace/workspace_window_resizer.cc
index e5449d6c892b491705215b891d0a6d03f6560cc6..b16d87243692a03747f5fa816de2a85a306d86e8 100644
--- a/ash/wm/workspace/workspace_window_resizer.cc
+++ b/ash/wm/workspace/workspace_window_resizer.cc
@@ -72,6 +72,14 @@ WorkspaceWindowResizer::~WorkspaceWindowResizer() {
Shell* shell = Shell::GetInstance();
shell->display_controller()->set_dont_warp_mouse(false);
shell->cursor_manager()->UnlockCursor();
+
+ // Delete phantom controllers first so that they will never see the deleted
+ // |layer_|.
+ snap_phantom_window_controller_.reset();
+ drag_phantom_window_controller_.reset();
+
+ if (layer_)
+ wm::DeepDeleteLayers(layer_);
}
// static
@@ -224,7 +232,8 @@ WorkspaceWindowResizer::WorkspaceWindowResizer(
total_min_(0),
total_initial_size_(0),
snap_type_(SNAP_NONE),
- num_mouse_moves_since_bounds_change_(0) {
+ num_mouse_moves_since_bounds_change_(0),
+ layer_(NULL) {
DCHECK(details_.is_resizable);
Shell* shell = Shell::GetInstance();
@@ -473,10 +482,13 @@ void WorkspaceWindowResizer::UpdateDragPhantomWindow(const gfx::Rect& bounds,
drag_phantom_window_controller_.reset(
new PhantomWindowController(window()));
drag_phantom_window_controller_->set_style(
- PhantomWindowController::STYLE_WINDOW);
+ PhantomWindowController::STYLE_NONE);
// Always show the drag phantom on the |another_root| window.
drag_phantom_window_controller_->SetDestinationDisplay(
gfx::Screen::GetDisplayMatching(another_root->GetBoundsInScreen()));
+ if (!layer_)
+ RecreateWindowLayers();
+ drag_phantom_window_controller_->set_layer(layer_);
drag_phantom_window_controller_->Show(bounds_in_screen);
} else {
// No animation.
@@ -569,5 +581,18 @@ bool WorkspaceWindowResizer::ShouldAllowMouseWarp() const {
(window()->type() == aura::client::WINDOW_TYPE_NORMAL);
}
+void WorkspaceWindowResizer::RecreateWindowLayers() {
+ DCHECK(!layer_);
+ layer_ = wm::RecreateWindowLayers(window());
+ layer_->set_delegate(window()->layer()->delegate());
+ // Place the layer at (0, 0) of the PhantomWindowController's window.
+ gfx::Rect layer_bounds = layer_->bounds();
+ layer_bounds.set_origin(gfx::Point(0, 0));
+ layer_->SetBounds(layer_bounds);
+ layer_->SetVisible(false);
+ // Detach it from the current container.
+ layer_->parent()->Remove(layer_);
+}
+
} // namespace internal
} // namespace ash
« no previous file with comments | « ash/wm/workspace/workspace_window_resizer.h ('k') | ash/wm/workspace/workspace_window_resizer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698