Chromium Code Reviews| 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 #ifndef ASH_WM_OVERVIEW_WINDOW_SELECTOR_ITEM_H_ | 5 #ifndef ASH_WM_OVERVIEW_WINDOW_SELECTOR_ITEM_H_ |
| 6 #define ASH_WM_OVERVIEW_WINDOW_SELECTOR_ITEM_H_ | 6 #define ASH_WM_OVERVIEW_WINDOW_SELECTOR_ITEM_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "ash/ash_export.h" | 10 #include "ash/ash_export.h" |
| 11 #include "ash/wm/overview/scoped_transform_overview_window.h" | 11 #include "ash/wm/overview/scoped_transform_overview_window.h" |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "ui/aura/window_observer.h" | 13 #include "ui/aura/window_observer.h" |
| 14 #include "ui/gfx/geometry/insets.h" | 14 #include "ui/gfx/geometry/insets.h" |
| 15 #include "ui/gfx/geometry/rect.h" | 15 #include "ui/gfx/geometry/rect.h" |
| 16 #include "ui/views/controls/button/button.h" | 16 #include "ui/views/controls/button/button.h" |
| 17 #include "ui/views/controls/button/image_button.h" | 17 #include "ui/views/controls/button/image_button.h" |
| 18 #include "ui/views/controls/label.h" | 18 #include "ui/views/controls/label.h" |
| 19 #include "ui/views/widget/widget.h" | 19 #include "ui/views/widget/widget.h" |
| 20 | 20 |
| 21 namespace aura { | |
| 22 class Window; | |
|
msw
2017/05/23 22:50:25
nit: not needed
varkha
2017/05/24 15:29:15
Done.
| |
| 23 } | |
| 24 | |
| 21 namespace gfx { | 25 namespace gfx { |
| 22 class SlideAnimation; | 26 class SlideAnimation; |
| 23 } | 27 } |
| 24 | 28 |
| 25 namespace views { | 29 namespace views { |
| 26 class ImageButton; | 30 class ImageButton; |
| 27 } | 31 } |
| 28 | 32 |
| 29 namespace ash { | 33 namespace ash { |
| 30 | 34 |
| 31 class WindowSelector; | 35 class WindowSelector; |
| 32 class WmWindow; | |
| 33 | 36 |
| 34 // This class represents an item in overview mode. | 37 // This class represents an item in overview mode. |
| 35 class ASH_EXPORT WindowSelectorItem : public views::ButtonListener, | 38 class ASH_EXPORT WindowSelectorItem : public views::ButtonListener, |
| 36 public aura::WindowObserver { | 39 public aura::WindowObserver { |
| 37 public: | 40 public: |
| 38 // An image button with a close window icon. | 41 // An image button with a close window icon. |
| 39 class OverviewCloseButton : public views::ImageButton { | 42 class OverviewCloseButton : public views::ImageButton { |
| 40 public: | 43 public: |
| 41 explicit OverviewCloseButton(views::ButtonListener* listener); | 44 explicit OverviewCloseButton(views::ButtonListener* listener); |
| 42 ~OverviewCloseButton() override; | 45 ~OverviewCloseButton() override; |
| 43 | 46 |
| 44 // Resets the listener so that the listener can go out of scope. | 47 // Resets the listener so that the listener can go out of scope. |
| 45 void ResetListener() { listener_ = nullptr; } | 48 void ResetListener() { listener_ = nullptr; } |
| 46 | 49 |
| 47 private: | 50 private: |
| 48 DISALLOW_COPY_AND_ASSIGN(OverviewCloseButton); | 51 DISALLOW_COPY_AND_ASSIGN(OverviewCloseButton); |
| 49 }; | 52 }; |
| 50 | 53 |
| 51 WindowSelectorItem(WmWindow* window, WindowSelector* window_selector); | 54 WindowSelectorItem(aura::Window* window, WindowSelector* window_selector); |
| 52 ~WindowSelectorItem() override; | 55 ~WindowSelectorItem() override; |
| 53 | 56 |
| 54 WmWindow* GetWindow(); | 57 aura::Window* GetWindow(); |
| 55 | 58 |
| 56 // Returns the root window on which this item is shown. | 59 // Returns the root window on which this item is shown. |
| 57 WmWindow* root_window() { return root_window_; } | 60 aura::Window* root_window() { return root_window_; } |
| 58 | 61 |
| 59 // Returns true if |target| is contained in this WindowSelectorItem. | 62 // Returns true if |target| is contained in this WindowSelectorItem. |
| 60 bool Contains(const WmWindow* target) const; | 63 bool Contains(const aura::Window* target) const; |
| 61 | 64 |
| 62 // Restores and animates the managed window to its non overview mode state. | 65 // Restores and animates the managed window to its non overview mode state. |
| 63 void RestoreWindow(); | 66 void RestoreWindow(); |
| 64 | 67 |
| 65 // Ensures that a possibly minimized window becomes visible after restore. | 68 // Ensures that a possibly minimized window becomes visible after restore. |
| 66 void EnsureVisible(); | 69 void EnsureVisible(); |
| 67 | 70 |
| 68 // Restores stacking of window captions above the windows, then fades out. | 71 // Restores stacking of window captions above the windows, then fades out. |
| 69 void Shutdown(); | 72 void Shutdown(); |
| 70 | 73 |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 158 | 161 |
| 159 // Updates the accessibility name to match the window title. | 162 // Updates the accessibility name to match the window title. |
| 160 void UpdateAccessibilityName(); | 163 void UpdateAccessibilityName(); |
| 161 | 164 |
| 162 // Fades out a window caption when exiting overview mode. | 165 // Fades out a window caption when exiting overview mode. |
| 163 void FadeOut(std::unique_ptr<views::Widget> widget); | 166 void FadeOut(std::unique_ptr<views::Widget> widget); |
| 164 | 167 |
| 165 // Allows a test to directly set animation state. | 168 // Allows a test to directly set animation state. |
| 166 gfx::SlideAnimation* GetBackgroundViewAnimation(); | 169 gfx::SlideAnimation* GetBackgroundViewAnimation(); |
| 167 | 170 |
| 168 WmWindow* GetOverviewWindowForMinimizedStateForTest(); | 171 aura::Window* GetOverviewWindowForMinimizedStateForTest(); |
| 169 | 172 |
| 170 // True if the item is being shown in the overview, false if it's being | 173 // True if the item is being shown in the overview, false if it's being |
| 171 // filtered. | 174 // filtered. |
| 172 bool dimmed_; | 175 bool dimmed_; |
| 173 | 176 |
| 174 // The root window this item is being displayed on. | 177 // The root window this item is being displayed on. |
| 175 WmWindow* root_window_; | 178 aura::Window* root_window_; |
| 176 | 179 |
| 177 // The contained Window's wrapper. | 180 // The contained Window's wrapper. |
| 178 ScopedTransformOverviewWindow transform_window_; | 181 ScopedTransformOverviewWindow transform_window_; |
| 179 | 182 |
| 180 // The target bounds this selector item is fit within. | 183 // The target bounds this selector item is fit within. |
| 181 gfx::Rect target_bounds_; | 184 gfx::Rect target_bounds_; |
| 182 | 185 |
| 183 // True if running SetItemBounds. This prevents recursive calls resulting from | 186 // True if running SetItemBounds. This prevents recursive calls resulting from |
| 184 // the bounds update when calling ::wm::RecreateWindowLayers to copy | 187 // the bounds update when calling ::wm::RecreateWindowLayers to copy |
| 185 // a window layer for display on another monitor. | 188 // a window layer for display on another monitor. |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 215 // corners. This view can have its color and opacity animated. It has a layer | 218 // corners. This view can have its color and opacity animated. It has a layer |
| 216 // which is the only textured layer used by the |item_widget_|. | 219 // which is the only textured layer used by the |item_widget_|. |
| 217 RoundedContainerView* background_view_; | 220 RoundedContainerView* background_view_; |
| 218 | 221 |
| 219 DISALLOW_COPY_AND_ASSIGN(WindowSelectorItem); | 222 DISALLOW_COPY_AND_ASSIGN(WindowSelectorItem); |
| 220 }; | 223 }; |
| 221 | 224 |
| 222 } // namespace ash | 225 } // namespace ash |
| 223 | 226 |
| 224 #endif // ASH_WM_OVERVIEW_WINDOW_SELECTOR_ITEM_H_ | 227 #endif // ASH_WM_OVERVIEW_WINDOW_SELECTOR_ITEM_H_ |
| OLD | NEW |