| 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 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 | 330 |
| 331 views::Widget* PanelLayoutManager::GetCalloutWidgetForPanel(WmWindow* panel) { | 331 views::Widget* PanelLayoutManager::GetCalloutWidgetForPanel(WmWindow* panel) { |
| 332 DCHECK(panel->GetParent() == panel_container_); | 332 DCHECK(panel->GetParent() == panel_container_); |
| 333 PanelList::iterator found = | 333 PanelList::iterator found = |
| 334 std::find(panel_windows_.begin(), panel_windows_.end(), panel); | 334 std::find(panel_windows_.begin(), panel_windows_.end(), panel); |
| 335 DCHECK(found != panel_windows_.end()); | 335 DCHECK(found != panel_windows_.end()); |
| 336 return found->callout_widget; | 336 return found->callout_widget; |
| 337 } | 337 } |
| 338 | 338 |
| 339 //////////////////////////////////////////////////////////////////////////////// | 339 //////////////////////////////////////////////////////////////////////////////// |
| 340 // PanelLayoutManager, WmLayoutManager implementation: | 340 // PanelLayoutManager, aura::LayoutManager implementation: |
| 341 void PanelLayoutManager::OnWindowResized() { | 341 void PanelLayoutManager::OnWindowResized() { |
| 342 Relayout(); | 342 Relayout(); |
| 343 } | 343 } |
| 344 | 344 |
| 345 void PanelLayoutManager::OnWindowAddedToLayout(Window* child) { | 345 void PanelLayoutManager::OnWindowAddedToLayout(Window* child) { |
| 346 if (child->type() == ui::wm::WINDOW_TYPE_POPUP) | 346 if (child->type() == ui::wm::WINDOW_TYPE_POPUP) |
| 347 return; | 347 return; |
| 348 if (in_add_window_) | 348 if (in_add_window_) |
| 349 return; | 349 return; |
| 350 base::AutoReset<bool> auto_reset_in_add_window(&in_add_window_, true); | 350 base::AutoReset<bool> auto_reset_in_add_window(&in_add_window_, true); |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 451 | 451 |
| 452 void PanelLayoutManager::OnOverviewModeEnded() { | 452 void PanelLayoutManager::OnOverviewModeEnded() { |
| 453 Relayout(); | 453 Relayout(); |
| 454 } | 454 } |
| 455 | 455 |
| 456 void PanelLayoutManager::OnShelfAlignmentChanged(WmWindow* root_window) { | 456 void PanelLayoutManager::OnShelfAlignmentChanged(WmWindow* root_window) { |
| 457 if (root_window_controller_->GetWindow() == root_window) | 457 if (root_window_controller_->GetWindow() == root_window) |
| 458 Relayout(); | 458 Relayout(); |
| 459 } | 459 } |
| 460 | 460 |
| 461 void PanelLayoutManager::OnVirtualKeyboardStateChanged(bool activated, | 461 void PanelLayoutManager::OnVirtualKeyboardStateChanged( |
| 462 WmWindow* root_window) { | 462 bool activated, |
| 463 UpdateKeyboardObserverFromStateChanged(activated, root_window, | 463 aura::Window* root_window) { |
| 464 panel_container_->GetRootWindow(), | 464 UpdateKeyboardObserverFromStateChanged( |
| 465 &keyboard_observer_); | 465 activated, root_window, panel_container_->GetRootWindow()->aura_window(), |
| 466 &keyboard_observer_); |
| 466 } | 467 } |
| 467 | 468 |
| 468 ///////////////////////////////////////////////////////////////////////////// | 469 ///////////////////////////////////////////////////////////////////////////// |
| 469 // PanelLayoutManager, WindowObserver implementation: | 470 // PanelLayoutManager, WindowObserver implementation: |
| 470 | 471 |
| 471 void PanelLayoutManager::OnWindowPropertyChanged(aura::Window* window, | 472 void PanelLayoutManager::OnWindowPropertyChanged(aura::Window* window, |
| 472 const void* key, | 473 const void* key, |
| 473 intptr_t old) { | 474 intptr_t old) { |
| 474 // Trigger a relayout to position the panels whenever the panel icon is set | 475 // Trigger a relayout to position the panels whenever the panel icon is set |
| 475 // or changes. | 476 // or changes. |
| (...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 940 // This bounds change will have caused a change to the Shelf which does not | 941 // This bounds change will have caused a change to the Shelf which does not |
| 941 // propogate automatically to this class, so manually recalculate bounds. | 942 // propogate automatically to this class, so manually recalculate bounds. |
| 942 OnWindowResized(); | 943 OnWindowResized(); |
| 943 } | 944 } |
| 944 | 945 |
| 945 void PanelLayoutManager::OnKeyboardClosed() { | 946 void PanelLayoutManager::OnKeyboardClosed() { |
| 946 keyboard_observer_.RemoveAll(); | 947 keyboard_observer_.RemoveAll(); |
| 947 } | 948 } |
| 948 | 949 |
| 949 } // namespace ash | 950 } // namespace ash |
| OLD | NEW |