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

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

Issue 2744463002: Add VectorIconButton functionality to ImageButton. (Closed)
Patch Set: fix cros build Created 3 years, 9 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 "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"
17 #include "ui/views/controls/button/image_button.h" 16 #include "ui/views/controls/button/image_button.h"
18 #include "ui/views/controls/label.h" 17 #include "ui/views/controls/label.h"
19 #include "ui/views/widget/widget.h" 18 #include "ui/views/widget/widget.h"
20 19
21 namespace gfx { 20 namespace gfx {
22 class SlideAnimation; 21 class SlideAnimation;
23 } 22 }
24 23
25 namespace views {
26 class ImageButton;
27 }
28
29 namespace ash { 24 namespace ash {
30 25
31 class WindowSelector; 26 class WindowSelector;
32 class WmWindow; 27 class WmWindow;
33 28
34 // This class represents an item in overview mode. 29 // This class represents an item in overview mode.
35 class ASH_EXPORT WindowSelectorItem : public views::ButtonListener, 30 class ASH_EXPORT WindowSelectorItem : public views::ImageButtonDelegate,
36 public aura::WindowObserver { 31 public aura::WindowObserver {
37 public: 32 public:
38 // An image button with a close window icon. 33 // An image button with a close window icon.
39 class OverviewCloseButton : public views::ImageButton { 34 class OverviewCloseButton : public views::ImageButton {
40 public: 35 public:
41 explicit OverviewCloseButton(views::ButtonListener* listener); 36 explicit OverviewCloseButton(views::ImageButtonDelegate* listener);
42 ~OverviewCloseButton() override; 37 ~OverviewCloseButton() override;
43 38
44 // Resets the listener so that the listener can go out of scope. 39 // Resets the listener so that the listener can go out of scope.
45 void ResetListener() { listener_ = nullptr; } 40 void ResetListener() { listener_ = nullptr; }
46 41
47 private: 42 private:
48 DISALLOW_COPY_AND_ASSIGN(OverviewCloseButton); 43 DISALLOW_COPY_AND_ASSIGN(OverviewCloseButton);
49 }; 44 };
50 45
51 WindowSelectorItem(WmWindow* window, WindowSelector* window_selector); 46 WindowSelectorItem(WmWindow* window, WindowSelector* window_selector);
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 // Called when the window is minimized or unminimized. 102 // Called when the window is minimized or unminimized.
108 void OnMinimizedStateChanged(); 103 void OnMinimizedStateChanged();
109 104
110 // Sets if the item is dimmed in the overview. Changing the value will also 105 // Sets if the item is dimmed in the overview. Changing the value will also
111 // change the visibility of the transform windows. 106 // change the visibility of the transform windows.
112 void SetDimmed(bool dimmed); 107 void SetDimmed(bool dimmed);
113 bool dimmed() const { return dimmed_; } 108 bool dimmed() const { return dimmed_; }
114 109
115 const gfx::Rect& target_bounds() const { return target_bounds_; } 110 const gfx::Rect& target_bounds() const { return target_bounds_; }
116 111
117 // views::ButtonListener: 112 // views::ImageButtonDelegate:
118 void ButtonPressed(views::Button* sender, const ui::Event& event) override; 113 void ButtonPressed(views::Button* sender, const ui::Event& event) override;
119 114
120 // aura::WindowObserver: 115 // aura::WindowObserver:
121 void OnWindowDestroying(aura::Window* window) override; 116 void OnWindowDestroying(aura::Window* window) override;
122 void OnWindowTitleChanged(aura::Window* window) override; 117 void OnWindowTitleChanged(aura::Window* window) override;
123 118
124 private: 119 private:
125 class CaptionContainerView; 120 class CaptionContainerView;
126 class RoundedContainerView; 121 class RoundedContainerView;
127 friend class WindowSelectorTest; 122 friend class WindowSelectorTest;
(...skipping 87 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 210 // 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_|. 211 // which is the only textured layer used by the |item_widget_|.
217 RoundedContainerView* background_view_; 212 RoundedContainerView* background_view_;
218 213
219 DISALLOW_COPY_AND_ASSIGN(WindowSelectorItem); 214 DISALLOW_COPY_AND_ASSIGN(WindowSelectorItem);
220 }; 215 };
221 216
222 } // namespace ash 217 } // namespace ash
223 218
224 #endif // ASH_COMMON_WM_OVERVIEW_WINDOW_SELECTOR_ITEM_H_ 219 #endif // ASH_COMMON_WM_OVERVIEW_WINDOW_SELECTOR_ITEM_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698