| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ash/wm/panels/panel_layout_manager.h" | 5 #include "ash/wm/panels/panel_layout_manager.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "ash/launcher/launcher.h" | 10 #include "ash/launcher/launcher.h" |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 delete iter->callout_widget; | 231 delete iter->callout_widget; |
| 232 } | 232 } |
| 233 panel_windows_.clear(); | 233 panel_windows_.clear(); |
| 234 if (launcher_) | 234 if (launcher_) |
| 235 launcher_->RemoveIconObserver(this); | 235 launcher_->RemoveIconObserver(this); |
| 236 launcher_ = NULL; | 236 launcher_ = NULL; |
| 237 } | 237 } |
| 238 | 238 |
| 239 void PanelLayoutManager::StartDragging(aura::Window* panel) { | 239 void PanelLayoutManager::StartDragging(aura::Window* panel) { |
| 240 DCHECK(!dragged_panel_); | 240 DCHECK(!dragged_panel_); |
| 241 DCHECK(panel->parent() == panel_container_); | |
| 242 dragged_panel_ = panel; | 241 dragged_panel_ = panel; |
| 243 Relayout(); | 242 Relayout(); |
| 244 } | 243 } |
| 245 | 244 |
| 246 void PanelLayoutManager::FinishDragging() { | 245 void PanelLayoutManager::FinishDragging() { |
| 247 dragged_panel_ = NULL; | 246 dragged_panel_ = NULL; |
| 248 Relayout(); | 247 Relayout(); |
| 249 } | 248 } |
| 250 | 249 |
| 251 void PanelLayoutManager::SetLauncher(ash::Launcher* launcher) { | 250 void PanelLayoutManager::SetLauncher(ash::Launcher* launcher) { |
| (...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 559 previous_panel = NULL; | 558 previous_panel = NULL; |
| 560 for (std::map<int, aura::Window*>::const_reverse_iterator it = | 559 for (std::map<int, aura::Window*>::const_reverse_iterator it = |
| 561 window_ordering.rbegin(); | 560 window_ordering.rbegin(); |
| 562 it != window_ordering.rend() && it->second != active_panel; ++it) { | 561 it != window_ordering.rend() && it->second != active_panel; ++it) { |
| 563 if (previous_panel) | 562 if (previous_panel) |
| 564 panel_container_->StackChildAbove(it->second, previous_panel); | 563 panel_container_->StackChildAbove(it->second, previous_panel); |
| 565 previous_panel = it->second; | 564 previous_panel = it->second; |
| 566 } | 565 } |
| 567 | 566 |
| 568 panel_container_->StackChildAtTop(active_panel); | 567 panel_container_->StackChildAtTop(active_panel); |
| 568 if (dragged_panel_ && dragged_panel_->parent() == panel_container_) |
| 569 panel_container_->StackChildAtTop(dragged_panel_); |
| 569 last_active_panel_ = active_panel; | 570 last_active_panel_ = active_panel; |
| 570 } | 571 } |
| 571 | 572 |
| 572 void PanelLayoutManager::UpdateCallouts() { | 573 void PanelLayoutManager::UpdateCallouts() { |
| 573 ShelfAlignment alignment = launcher_->alignment(); | 574 ShelfAlignment alignment = launcher_->alignment(); |
| 574 bool horizontal = alignment == SHELF_ALIGNMENT_TOP || | 575 bool horizontal = alignment == SHELF_ALIGNMENT_TOP || |
| 575 alignment == SHELF_ALIGNMENT_BOTTOM; | 576 alignment == SHELF_ALIGNMENT_BOTTOM; |
| 576 | 577 |
| 577 for (PanelList::iterator iter = panel_windows_.begin(); | 578 for (PanelList::iterator iter = panel_windows_.begin(); |
| 578 iter != panel_windows_.end(); ++iter) { | 579 iter != panel_windows_.end(); ++iter) { |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 617 | 618 |
| 618 SetChildBoundsDirect(callout_widget->GetNativeWindow(), callout_bounds); | 619 SetChildBoundsDirect(callout_widget->GetNativeWindow(), callout_bounds); |
| 619 panel_container_->StackChildAbove(callout_widget->GetNativeWindow(), | 620 panel_container_->StackChildAbove(callout_widget->GetNativeWindow(), |
| 620 panel); | 621 panel); |
| 621 callout_widget->Show(); | 622 callout_widget->Show(); |
| 622 } | 623 } |
| 623 } | 624 } |
| 624 | 625 |
| 625 } // namespace internal | 626 } // namespace internal |
| 626 } // namespace ash | 627 } // namespace ash |
| OLD | NEW |