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

Unified Diff: ash/wm/panels/panel_layout_manager.cc

Issue 12441010: Attach panel while dragging to bring it in front of other panels. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments, etc. Created 7 years, 9 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: ash/wm/panels/panel_layout_manager.cc
diff --git a/ash/wm/panels/panel_layout_manager.cc b/ash/wm/panels/panel_layout_manager.cc
index 3bd70369c6c621d34451a5dc70f64c8801bc11dd..3d7eee43b0d3c0eddd09eb18afc72622e9ded175 100644
--- a/ash/wm/panels/panel_layout_manager.cc
+++ b/ash/wm/panels/panel_layout_manager.cc
@@ -238,14 +238,11 @@ void PanelLayoutManager::Shutdown() {
void PanelLayoutManager::StartDragging(aura::Window* panel) {
DCHECK(!dragged_panel_);
- DCHECK(panel->parent() == panel_container_);
dragged_panel_ = panel;
Relayout();
}
void PanelLayoutManager::FinishDragging() {
- // Note, dragged panel may be null if the panel was just attached to the
- // panel layout.
dragged_panel_ = NULL;
Relayout();
}
@@ -279,7 +276,10 @@ void PanelLayoutManager::OnWindowAddedToLayout(aura::Window* child) {
panel_info.callout_widget = new PanelCalloutWidget(panel_container_);
panel_windows_.push_back(panel_info);
child->AddObserver(this);
- Relayout();
+ // When dragging a panel on the default container it is temporarily added to
+ // the panel container and doesn't require a relayout.
+ if (child != dragged_panel_)
+ Relayout();
}
void PanelLayoutManager::OnWillRemoveWindowFromLayout(aura::Window* child) {

Powered by Google App Engine
This is Rietveld 408576698