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/screen_util.h" | 7 #include "ash/screen_util.h" |
8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
9 #include "ash/shell_window_ids.h" | 9 #include "ash/shell_window_ids.h" |
10 #include "ash/wm/overview/scoped_transform_overview_window.h" | 10 #include "ash/wm/overview/scoped_transform_overview_window.h" |
11 #include "ash/wm/overview/transparent_activate_window_button.h" | 11 #include "ash/wm/overview/transparent_activate_window_button.h" |
12 #include "ash/wm/panels/panel_layout_manager.h" | 12 #include "ash/wm/panels/panel_layout_manager.h" |
13 #include "ash/wm/window_util.h" | 13 #include "ash/wm/window_util.h" |
14 #include "ui/aura/window.h" | 14 #include "ui/aura/window.h" |
15 #include "ui/compositor/layer.h" | 15 #include "ui/compositor/layer.h" |
16 #include "ui/compositor/layer_animation_observer.h" | 16 #include "ui/compositor/layer_animation_observer.h" |
17 #include "ui/compositor/layer_animation_sequence.h" | 17 #include "ui/compositor/layer_animation_sequence.h" |
18 #include "ui/views/controls/button/button.h" | 18 #include "ui/views/controls/button/button.h" |
19 | 19 |
20 namespace ash { | 20 namespace ash { |
21 | 21 |
22 namespace { | 22 namespace { |
23 | 23 |
24 // This class extends ScopedTransformOverviewMode to hide and show the callout | 24 // This class extends ScopedTransformOverviewMode to hide and show the callout |
25 // widget for a panel window when entering / leaving overview mode, as well as | 25 // widget for a panel window when entering / leaving overview mode, as well as |
26 // to add a transparent button for each panel window. | 26 // to add a transparent button for each panel window. |
27 class ScopedTransformPanelWindow : public ScopedTransformOverviewWindow { | 27 class ScopedTransformPanelWindow : public ScopedTransformOverviewWindow { |
28 public: | 28 public: |
29 explicit ScopedTransformPanelWindow(aura::Window* window); | 29 explicit ScopedTransformPanelWindow(aura::Window* window); |
30 virtual ~ScopedTransformPanelWindow(); | 30 ~ScopedTransformPanelWindow() override; |
31 | 31 |
32 // ScopedTransformOverviewWindow overrides: | 32 // ScopedTransformOverviewWindow overrides: |
33 virtual void PrepareForOverview() override; | 33 void PrepareForOverview() override; |
34 | 34 |
35 virtual void SetTransform( | 35 void SetTransform(aura::Window* root_window, |
36 aura::Window* root_window, | 36 const gfx::Transform& transform, |
37 const gfx::Transform& transform, | 37 bool animate) override; |
38 bool animate) override; | |
39 | 38 |
40 private: | 39 private: |
41 // Returns the panel window bounds after the transformation. | 40 // Returns the panel window bounds after the transformation. |
42 gfx::Rect GetTransformedBounds(); | 41 gfx::Rect GetTransformedBounds(); |
43 | 42 |
44 scoped_ptr<TransparentActivateWindowButton> window_button_; | 43 scoped_ptr<TransparentActivateWindowButton> window_button_; |
45 | 44 |
46 DISALLOW_COPY_AND_ASSIGN(ScopedTransformPanelWindow); | 45 DISALLOW_COPY_AND_ASSIGN(ScopedTransformPanelWindow); |
47 }; | 46 }; |
48 | 47 |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 // TODO(flackr): find a way to make panels that are hidden behind other panels | 208 // TODO(flackr): find a way to make panels that are hidden behind other panels |
210 // look nice. | 209 // look nice. |
211 for (WindowList::iterator iter = transform_windows_.begin(); | 210 for (WindowList::iterator iter = transform_windows_.begin(); |
212 iter != transform_windows_.end(); iter++) { | 211 iter != transform_windows_.end(); iter++) { |
213 (*iter)->window()->layer()->SetOpacity(opacity); | 212 (*iter)->window()->layer()->SetOpacity(opacity); |
214 } | 213 } |
215 WindowSelectorItem::SetOpacity(opacity); | 214 WindowSelectorItem::SetOpacity(opacity); |
216 } | 215 } |
217 | 216 |
218 } // namespace ash | 217 } // namespace ash |
OLD | NEW |