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

Side by Side Diff: ash/common/wm/overview/window_selector_item.h

Issue 2699033002: Replace WmWindowObserver with aura::WindowObserver. (Closed)
Patch Set: Check for null images in ShelfWindowWatcher. Created 3 years, 10 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
OLDNEW
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"
13 #include "base/macros.h" 12 #include "base/macros.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 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 ash { 29 namespace ash {
30 30
31 class WindowSelector; 31 class WindowSelector;
32 class WmWindow; 32 class WmWindow;
33 33
34 // This class represents an item in overview mode. 34 // This class represents an item in overview mode.
35 class ASH_EXPORT WindowSelectorItem : public views::ButtonListener, 35 class ASH_EXPORT WindowSelectorItem : public views::ButtonListener,
36 public WmWindowObserver { 36 public aura::WindowObserver {
37 public: 37 public:
38 // An image button with a close window icon. 38 // An image button with a close window icon.
39 class OverviewCloseButton : public views::ImageButton { 39 class OverviewCloseButton : public views::ImageButton {
40 public: 40 public:
41 explicit OverviewCloseButton(views::ButtonListener* listener); 41 explicit OverviewCloseButton(views::ButtonListener* listener);
42 ~OverviewCloseButton() override; 42 ~OverviewCloseButton() override;
43 43
44 // Resets the listener so that the listener can go out of scope. 44 // Resets the listener so that the listener can go out of scope.
45 void ResetListener() { listener_ = nullptr; } 45 void ResetListener() { listener_ = nullptr; }
46 46
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 // Sets if the item is dimmed in the overview. Changing the value will also 110 // Sets if the item is dimmed in the overview. Changing the value will also
111 // change the visibility of the transform windows. 111 // change the visibility of the transform windows.
112 void SetDimmed(bool dimmed); 112 void SetDimmed(bool dimmed);
113 bool dimmed() const { return dimmed_; } 113 bool dimmed() const { return dimmed_; }
114 114
115 const gfx::Rect& target_bounds() const { return target_bounds_; } 115 const gfx::Rect& target_bounds() const { return target_bounds_; }
116 116
117 // views::ButtonListener: 117 // views::ButtonListener:
118 void ButtonPressed(views::Button* sender, const ui::Event& event) override; 118 void ButtonPressed(views::Button* sender, const ui::Event& event) override;
119 119
120 // WmWindowObserver: 120 // aura::WindowObserver:
121 void OnWindowDestroying(WmWindow* window) override; 121 void OnWindowDestroying(aura::Window* window) override;
122 void OnWindowTitleChanged(WmWindow* window) override; 122 void OnWindowTitleChanged(aura::Window* window) override;
123 123
124 private: 124 private:
125 class CaptionContainerView; 125 class CaptionContainerView;
126 class RoundedContainerView; 126 class RoundedContainerView;
127 friend class WindowSelectorTest; 127 friend class WindowSelectorTest;
128 128
129 enum class HeaderFadeInMode { 129 enum class HeaderFadeInMode {
130 ENTER, 130 ENTER,
131 UPDATE, 131 UPDATE,
132 EXIT, 132 EXIT,
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 // 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
216 // which is the only textured layer used by the |item_widget_|. 216 // which is the only textured layer used by the |item_widget_|.
217 RoundedContainerView* background_view_; 217 RoundedContainerView* background_view_;
218 218
219 DISALLOW_COPY_AND_ASSIGN(WindowSelectorItem); 219 DISALLOW_COPY_AND_ASSIGN(WindowSelectorItem);
220 }; 220 };
221 221
222 } // namespace ash 222 } // namespace ash
223 223
224 #endif // ASH_COMMON_WM_OVERVIEW_WINDOW_SELECTOR_ITEM_H_ 224 #endif // ASH_COMMON_WM_OVERVIEW_WINDOW_SELECTOR_ITEM_H_
OLDNEW
« no previous file with comments | « ash/common/wm/overview/window_selector.cc ('k') | ash/common/wm/overview/window_selector_item.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698