OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/overview/window_selector_panels.h" | 5 #include "ash/wm/overview/window_selector_panels.h" |
6 | 6 |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "ash/shell_window_ids.h" | 8 #include "ash/shell_window_ids.h" |
9 #include "ash/wm/overview/scoped_transform_overview_window.h" | 9 #include "ash/wm/overview/scoped_transform_overview_window.h" |
10 #include "ash/wm/panels/panel_layout_manager.h" | 10 #include "ash/wm/panels/panel_layout_manager.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 if (window()) | 55 if (window()) |
56 RestoreCallout(); | 56 RestoreCallout(); |
57 } | 57 } |
58 | 58 |
59 void ScopedTransformPanelWindow::PrepareForOverview() { | 59 void ScopedTransformPanelWindow::PrepareForOverview() { |
60 ScopedTransformOverviewWindow::PrepareForOverview(); | 60 ScopedTransformOverviewWindow::PrepareForOverview(); |
61 GetCalloutWidget()->GetLayer()->SetOpacity(0.0f); | 61 GetCalloutWidget()->GetLayer()->SetOpacity(0.0f); |
62 } | 62 } |
63 | 63 |
64 views::Widget* ScopedTransformPanelWindow::GetCalloutWidget() { | 64 views::Widget* ScopedTransformPanelWindow::GetCalloutWidget() { |
65 DCHECK(window()->parent()->id() == internal::kShellWindowId_PanelContainer); | 65 DCHECK(window()->parent()->id() == kShellWindowId_PanelContainer); |
66 internal::PanelLayoutManager* panel_layout_manager = | 66 PanelLayoutManager* panel_layout_manager = |
67 static_cast<internal::PanelLayoutManager*>( | 67 static_cast<PanelLayoutManager*>(window()->parent()->layout_manager()); |
68 window()->parent()->layout_manager()); | |
69 return panel_layout_manager->GetCalloutWidgetForPanel(window()); | 68 return panel_layout_manager->GetCalloutWidgetForPanel(window()); |
70 } | 69 } |
71 | 70 |
72 void ScopedTransformPanelWindow::RestoreCallout() { | 71 void ScopedTransformPanelWindow::RestoreCallout() { |
73 scoped_ptr<ui::LayerAnimationSequence> sequence( | 72 scoped_ptr<ui::LayerAnimationSequence> sequence( |
74 new ui::LayerAnimationSequence); | 73 new ui::LayerAnimationSequence); |
75 sequence->AddElement(ui::LayerAnimationElement::CreatePauseElement( | 74 sequence->AddElement(ui::LayerAnimationElement::CreatePauseElement( |
76 ui::LayerAnimationElement::OPACITY, base::TimeDelta::FromMilliseconds( | 75 ui::LayerAnimationElement::OPACITY, base::TimeDelta::FromMilliseconds( |
77 ScopedTransformOverviewWindow::kTransitionMilliseconds))); | 76 ScopedTransformOverviewWindow::kTransitionMilliseconds))); |
78 sequence->AddElement(ui::LayerAnimationElement::CreateOpacityElement(1, | 77 sequence->AddElement(ui::LayerAnimationElement::CreateOpacityElement(1, |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 transform.Translate(bounding_rect.x() - bounds.x(), | 171 transform.Translate(bounding_rect.x() - bounds.x(), |
173 bounding_rect.y() - bounds.y()); | 172 bounding_rect.y() - bounds.y()); |
174 transform.PreconcatTransform(bounding_transform); | 173 transform.PreconcatTransform(bounding_transform); |
175 transform.Translate(bounds.x() - bounding_rect.x(), | 174 transform.Translate(bounds.x() - bounding_rect.x(), |
176 bounds.y() - bounding_rect.y()); | 175 bounds.y() - bounding_rect.y()); |
177 (*iter)->SetTransform(root_window, transform, animate); | 176 (*iter)->SetTransform(root_window, transform, animate); |
178 } | 177 } |
179 } | 178 } |
180 | 179 |
181 } // namespace ash | 180 } // namespace ash |
OLD | NEW |