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

Side by Side Diff: ash/wm/panels/panel_layout_manager.cc

Issue 1659283002: ash: Explicitly teach various components about ShelfLayoutManager. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ozone-ui-event-platform-event
Patch Set: fix-test Created 4 years, 10 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 unified diff | Download patch
« no previous file with comments | « ash/wm/dock/docked_window_layout_manager.cc ('k') | ash/wm/window_animations.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 dragged_panel_ = NULL; 305 dragged_panel_ = NULL;
306 Relayout(); 306 Relayout();
307 } 307 }
308 308
309 void PanelLayoutManager::SetShelf(Shelf* shelf) { 309 void PanelLayoutManager::SetShelf(Shelf* shelf) {
310 DCHECK(!shelf_); 310 DCHECK(!shelf_);
311 DCHECK(!shelf_layout_manager_); 311 DCHECK(!shelf_layout_manager_);
312 shelf_ = shelf; 312 shelf_ = shelf;
313 shelf_->AddIconObserver(this); 313 shelf_->AddIconObserver(this);
314 if (shelf_->shelf_widget()) { 314 if (shelf_->shelf_widget()) {
315 shelf_layout_manager_ = ash::ShelfLayoutManager::ForShelf( 315 shelf_layout_manager_ = shelf_->shelf_widget()->shelf_layout_manager();
316 shelf_->shelf_widget()->GetNativeWindow());
317 WillChangeVisibilityState(shelf_layout_manager_->visibility_state()); 316 WillChangeVisibilityState(shelf_layout_manager_->visibility_state());
318 shelf_layout_manager_->AddObserver(this); 317 shelf_layout_manager_->AddObserver(this);
319 } 318 }
320 } 319 }
321 320
322 void PanelLayoutManager::ToggleMinimize(aura::Window* panel) { 321 void PanelLayoutManager::ToggleMinimize(aura::Window* panel) {
323 DCHECK(panel->parent() == panel_container_); 322 DCHECK(panel->parent() == panel_container_);
324 wm::WindowState* window_state = wm::GetWindowState(panel); 323 wm::WindowState* window_state = wm::GetWindowState(panel);
325 if (window_state->IsMinimized()) 324 if (window_state->IsMinimized())
326 window_state->Restore(); 325 window_state->Restore();
(...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after
952 // Keyboard hidden, restore original bounds if they exist. 951 // Keyboard hidden, restore original bounds if they exist.
953 SetChildBounds(panel, panel_state->GetRestoreBoundsInScreen()); 952 SetChildBounds(panel, panel_state->GetRestoreBoundsInScreen());
954 } 953 }
955 } 954 }
956 // This bounds change will have caused a change to the Shelf which does not 955 // This bounds change will have caused a change to the Shelf which does not
957 // propogate automatically to this class, so manually recalculate bounds. 956 // propogate automatically to this class, so manually recalculate bounds.
958 OnWindowResized(); 957 OnWindowResized();
959 } 958 }
960 959
961 } // namespace ash 960 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/dock/docked_window_layout_manager.cc ('k') | ash/wm/window_animations.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698