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

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

Issue 23654037: Add panels as a single group of windows per display for overview window cycling. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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 | Annotate | Revision Log
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 9
10 #include "ash/launcher/launcher.h" 10 #include "ash/launcher/launcher.h"
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
323 void PanelLayoutManager::ToggleMinimize(aura::Window* panel) { 323 void PanelLayoutManager::ToggleMinimize(aura::Window* panel) {
324 DCHECK(panel->parent() == panel_container_); 324 DCHECK(panel->parent() == panel_container_);
325 if (panel->GetProperty(aura::client::kShowStateKey) == 325 if (panel->GetProperty(aura::client::kShowStateKey) ==
326 ui::SHOW_STATE_MINIMIZED) { 326 ui::SHOW_STATE_MINIMIZED) {
327 panel->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_NORMAL); 327 panel->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_NORMAL);
328 } else { 328 } else {
329 panel->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MINIMIZED); 329 panel->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MINIMIZED);
330 } 330 }
331 } 331 }
332 332
333 views::Widget* PanelLayoutManager::GetCalloutWidgetForPanel(
334 aura::Window* panel) {
335 DCHECK(panel->parent() == panel_container_);
336 PanelList::iterator found =
337 std::find(panel_windows_.begin(), panel_windows_.end(), panel);
338 DCHECK(found != panel_windows_.end());
339 return found->callout_widget;
340 }
341
333 //////////////////////////////////////////////////////////////////////////////// 342 ////////////////////////////////////////////////////////////////////////////////
334 // PanelLayoutManager, aura::LayoutManager implementation: 343 // PanelLayoutManager, aura::LayoutManager implementation:
335 void PanelLayoutManager::OnWindowResized() { 344 void PanelLayoutManager::OnWindowResized() {
336 Relayout(); 345 Relayout();
337 } 346 }
338 347
339 void PanelLayoutManager::OnWindowAddedToLayout(aura::Window* child) { 348 void PanelLayoutManager::OnWindowAddedToLayout(aura::Window* child) {
340 if (child->type() == aura::client::WINDOW_TYPE_POPUP) 349 if (child->type() == aura::client::WINDOW_TYPE_POPUP)
341 return; 350 return;
342 if (in_add_window_) 351 if (in_add_window_)
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after
825 callout_bounds); 834 callout_bounds);
826 835
827 SetChildBoundsDirect(callout_widget->GetNativeWindow(), callout_bounds); 836 SetChildBoundsDirect(callout_widget->GetNativeWindow(), callout_bounds);
828 panel_container_->StackChildAbove(callout_widget->GetNativeWindow(), 837 panel_container_->StackChildAbove(callout_widget->GetNativeWindow(),
829 panel); 838 panel);
830 callout_widget->Show(); 839 callout_widget->Show();
831 840
832 ui::Layer* layer = callout_widget->GetNativeWindow()->layer(); 841 ui::Layer* layer = callout_widget->GetNativeWindow()->layer();
833 // If the panel is not over the callout position or has just become visible 842 // If the panel is not over the callout position or has just become visible
834 // then fade in the callout. 843 // then fade in the callout.
835 if (distance_until_over_panel > 0 || layer->GetTargetOpacity() < 1) { 844 if ((distance_until_over_panel > 0 || layer->GetTargetOpacity() < 1) &&
845 panel->layer()->GetTargetTransform().IsIdentity()) {
836 if (distance_until_over_panel > 0 && 846 if (distance_until_over_panel > 0 &&
837 slide_distance >= distance_until_over_panel) { 847 slide_distance >= distance_until_over_panel) {
838 layer->SetOpacity(0); 848 layer->SetOpacity(0);
839 // If the panel is not yet over the callout, then delay fading in 849 // If the panel is not yet over the callout, then delay fading in
840 // the callout until after the panel should be over it. 850 // the callout until after the panel should be over it.
841 int delay = kPanelSlideDurationMilliseconds * 851 int delay = kPanelSlideDurationMilliseconds *
842 distance_until_over_panel / slide_distance; 852 distance_until_over_panel / slide_distance;
843 layer->SetOpacity(0); 853 layer->SetOpacity(0);
844 layer->GetAnimator()->StopAnimating(); 854 layer->GetAnimator()->StopAnimating();
845 layer->GetAnimator()->SchedulePauseForProperties( 855 layer->GetAnimator()->SchedulePauseForProperties(
(...skipping 18 matching lines...) Expand all
864 874
865 void PanelLayoutManager::OnKeyboardBoundsChanging( 875 void PanelLayoutManager::OnKeyboardBoundsChanging(
866 const gfx::Rect& keyboard_bounds) { 876 const gfx::Rect& keyboard_bounds) {
867 // This bounds change will have caused a change to the Shelf which does not 877 // This bounds change will have caused a change to the Shelf which does not
868 // propogate automatically to this class, so manually recalculate bounds. 878 // propogate automatically to this class, so manually recalculate bounds.
869 OnWindowResized(); 879 OnWindowResized();
870 } 880 }
871 881
872 } // namespace internal 882 } // namespace internal
873 } // namespace ash 883 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698