| 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/common/wm/panels/panel_layout_manager.h" | 5 #include "ash/common/wm/panels/panel_layout_manager.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <map> | 8 #include <map> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 in_layout_(false), | 246 in_layout_(false), |
| 247 show_callout_widgets_(true), | 247 show_callout_widgets_(true), |
| 248 dragged_panel_(NULL), | 248 dragged_panel_(NULL), |
| 249 shelf_(nullptr), | 249 shelf_(nullptr), |
| 250 last_active_panel_(NULL), | 250 last_active_panel_(NULL), |
| 251 weak_factory_(this) { | 251 weak_factory_(this) { |
| 252 DCHECK(panel_container); | 252 DCHECK(panel_container); |
| 253 WmShell* shell = panel_container->GetShell(); | 253 WmShell* shell = panel_container->GetShell(); |
| 254 Shell::GetInstance()->activation_client()->AddObserver(this); | 254 Shell::GetInstance()->activation_client()->AddObserver(this); |
| 255 shell->AddDisplayObserver(this); | 255 shell->AddDisplayObserver(this); |
| 256 shell->AddShellObserver(this); | 256 Shell::GetInstance()->AddShellObserver(this); |
| 257 } | 257 } |
| 258 | 258 |
| 259 PanelLayoutManager::~PanelLayoutManager() { | 259 PanelLayoutManager::~PanelLayoutManager() { |
| 260 Shutdown(); | 260 Shutdown(); |
| 261 } | 261 } |
| 262 | 262 |
| 263 // static | 263 // static |
| 264 PanelLayoutManager* PanelLayoutManager::Get(WmWindow* window) { | 264 PanelLayoutManager* PanelLayoutManager::Get(WmWindow* window) { |
| 265 if (!window) | 265 if (!window) |
| 266 return nullptr; | 266 return nullptr; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 277 shelf_ = nullptr; | 277 shelf_ = nullptr; |
| 278 } | 278 } |
| 279 for (PanelList::iterator iter = panel_windows_.begin(); | 279 for (PanelList::iterator iter = panel_windows_.begin(); |
| 280 iter != panel_windows_.end(); ++iter) { | 280 iter != panel_windows_.end(); ++iter) { |
| 281 delete iter->callout_widget; | 281 delete iter->callout_widget; |
| 282 } | 282 } |
| 283 panel_windows_.clear(); | 283 panel_windows_.clear(); |
| 284 WmShell* shell = panel_container_->GetShell(); | 284 WmShell* shell = panel_container_->GetShell(); |
| 285 Shell::GetInstance()->activation_client()->RemoveObserver(this); | 285 Shell::GetInstance()->activation_client()->RemoveObserver(this); |
| 286 shell->RemoveDisplayObserver(this); | 286 shell->RemoveDisplayObserver(this); |
| 287 shell->RemoveShellObserver(this); | 287 Shell::GetInstance()->RemoveShellObserver(this); |
| 288 } | 288 } |
| 289 | 289 |
| 290 void PanelLayoutManager::StartDragging(WmWindow* panel) { | 290 void PanelLayoutManager::StartDragging(WmWindow* panel) { |
| 291 DCHECK(!dragged_panel_); | 291 DCHECK(!dragged_panel_); |
| 292 dragged_panel_ = panel; | 292 dragged_panel_ = panel; |
| 293 Relayout(); | 293 Relayout(); |
| 294 } | 294 } |
| 295 | 295 |
| 296 void PanelLayoutManager::FinishDragging() { | 296 void PanelLayoutManager::FinishDragging() { |
| 297 dragged_panel_ = NULL; | 297 dragged_panel_ = NULL; |
| (...skipping 627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 925 } | 925 } |
| 926 } | 926 } |
| 927 // This bounds change will have caused a change to the Shelf which does not | 927 // This bounds change will have caused a change to the Shelf which does not |
| 928 // propogate automatically to this class, so manually recalculate bounds. | 928 // propogate automatically to this class, so manually recalculate bounds. |
| 929 OnWindowResized(); | 929 OnWindowResized(); |
| 930 } | 930 } |
| 931 | 931 |
| 932 void PanelLayoutManager::OnKeyboardClosed() {} | 932 void PanelLayoutManager::OnKeyboardClosed() {} |
| 933 | 933 |
| 934 } // namespace ash | 934 } // namespace ash |
| OLD | NEW |