| 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_COMMON_WM_OVERVIEW_WINDOW_SELECTOR_ITEM_H_ | 5 #ifndef ASH_COMMON_WM_OVERVIEW_WINDOW_SELECTOR_ITEM_H_ |
| 6 #define ASH_COMMON_WM_OVERVIEW_WINDOW_SELECTOR_ITEM_H_ | 6 #define ASH_COMMON_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/common/wm/overview/scoped_transform_overview_window.h" | 11 #include "ash/common/wm/overview/scoped_transform_overview_window.h" |
| 12 #include "ash/common/wm_window_observer.h" | 12 #include "ash/common/wm_window_observer.h" |
| 13 #include "base/macros.h" | 13 #include "base/macros.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 gfx { | 21 namespace gfx { |
| 22 class SlideAnimation; | 22 class SlideAnimation; |
| 23 } | 23 } |
| 24 | 24 |
| 25 namespace views { | 25 namespace views { |
| 26 class ImageButton; | 26 class ImageButton; |
| 27 } | 27 } |
| 28 | 28 |
| 29 namespace wm { | |
| 30 class Shadow; | |
| 31 } | |
| 32 | |
| 33 namespace ash { | 29 namespace ash { |
| 34 | 30 |
| 35 class WindowSelector; | 31 class WindowSelector; |
| 36 class WmWindow; | 32 class WmWindow; |
| 37 | 33 |
| 38 // This class represents an item in overview mode. | 34 // This class represents an item in overview mode. |
| 39 class ASH_EXPORT WindowSelectorItem : public views::ButtonListener, | 35 class ASH_EXPORT WindowSelectorItem : public views::ButtonListener, |
| 40 public WmWindowObserver { | 36 public WmWindowObserver { |
| 41 public: | 37 public: |
| 42 // An image button with a close window icon. | 38 // An image button with a close window icon. |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 | 187 |
| 192 // True when |this| item is visually selected. Item header is made transparent | 188 // True when |this| item is visually selected. Item header is made transparent |
| 193 // when the item is selected. | 189 // when the item is selected. |
| 194 bool selected_; | 190 bool selected_; |
| 195 | 191 |
| 196 // A widget that covers the |transform_window_|. The widget has | 192 // A widget that covers the |transform_window_|. The widget has |
| 197 // |caption_container_view_| as its contents view. The widget is backed by a | 193 // |caption_container_view_| as its contents view. The widget is backed by a |
| 198 // NOT_DRAWN layer since most of its surface is transparent. | 194 // NOT_DRAWN layer since most of its surface is transparent. |
| 199 std::unique_ptr<views::Widget> item_widget_; | 195 std::unique_ptr<views::Widget> item_widget_; |
| 200 | 196 |
| 201 // Shadow around the item in overview. | |
| 202 std::unique_ptr<::wm::Shadow> shadow_; | |
| 203 | |
| 204 // Container view that owns a Button view covering the |transform_window_|. | 197 // Container view that owns a Button view covering the |transform_window_|. |
| 205 // That button serves as an event shield to receive all events such as clicks | 198 // That button serves as an event shield to receive all events such as clicks |
| 206 // targeting the |transform_window_| or the overview header above the window. | 199 // targeting the |transform_window_| or the overview header above the window. |
| 207 // The shield button owns |background_view_| which owns |label_view_| | 200 // The shield button owns |background_view_| which owns |label_view_| |
| 208 // and |close_button_|. | 201 // and |close_button_|. |
| 209 CaptionContainerView* caption_container_view_; | 202 CaptionContainerView* caption_container_view_; |
| 210 | 203 |
| 211 // A View for the text label above the window owned by the |background_view_|. | 204 // A View for the text label above the window owned by the |background_view_|. |
| 212 views::Label* label_view_; | 205 views::Label* label_view_; |
| 213 | 206 |
| 214 // A close button for the window in this item owned by the |background_view_|. | 207 // A close button for the window in this item owned by the |background_view_|. |
| 215 OverviewCloseButton* close_button_; | 208 OverviewCloseButton* close_button_; |
| 216 | 209 |
| 217 // Pointer to the WindowSelector that owns the WindowGrid containing |this|. | 210 // Pointer to the WindowSelector that owns the WindowGrid containing |this|. |
| 218 // Guaranteed to be non-null for the lifetime of |this|. | 211 // Guaranteed to be non-null for the lifetime of |this|. |
| 219 WindowSelector* window_selector_; | 212 WindowSelector* window_selector_; |
| 220 | 213 |
| 221 // Pointer to a view that covers the original header and has rounded top | 214 // Pointer to a view that covers the original header and has rounded top |
| 222 // corners. This view can have its color and opacity animated. It has a layer | 215 // corners. This view can have its color and opacity animated. It has a layer |
| 223 // which is the only textured layer used by the |item_widget_|. | 216 // which is the only textured layer used by the |item_widget_|. |
| 224 RoundedContainerView* background_view_; | 217 RoundedContainerView* background_view_; |
| 225 | 218 |
| 226 DISALLOW_COPY_AND_ASSIGN(WindowSelectorItem); | 219 DISALLOW_COPY_AND_ASSIGN(WindowSelectorItem); |
| 227 }; | 220 }; |
| 228 | 221 |
| 229 } // namespace ash | 222 } // namespace ash |
| 230 | 223 |
| 231 #endif // ASH_COMMON_WM_OVERVIEW_WINDOW_SELECTOR_ITEM_H_ | 224 #endif // ASH_COMMON_WM_OVERVIEW_WINDOW_SELECTOR_ITEM_H_ |
| OLD | NEW |