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

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

Issue 810033010: Remove TransparentActivateWindowButton from Overview Mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed nits Created 5 years, 11 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_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 "ash/ash_export.h" 8 #include "ash/ash_export.h"
9 #include "ash/wm/overview/scoped_transform_overview_window.h" 9 #include "ash/wm/overview/scoped_transform_overview_window.h"
10 #include "ash/wm/overview/transparent_activate_window_button.h"
11 #include "ash/wm/overview/transparent_activate_window_button_delegate.h"
12 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
13 #include "base/memory/scoped_ptr.h" 11 #include "base/memory/scoped_ptr.h"
12 #include "ui/aura/scoped_window_targeter.h"
14 #include "ui/aura/window_observer.h" 13 #include "ui/aura/window_observer.h"
15 #include "ui/gfx/geometry/rect.h" 14 #include "ui/gfx/geometry/rect.h"
16 #include "ui/views/controls/button/button.h" 15 #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 17
19 namespace aura { 18 namespace aura {
20 class Window; 19 class Window;
21 } 20 }
22 21
23 namespace views { 22 namespace views {
24 class Label; 23 class LabelButton;
25 class Widget; 24 class Widget;
26 } 25 }
27 26
28 namespace ash { 27 namespace ash {
29 28
29 class OverviewWindowButton;
30
30 // This class represents an item in overview mode. 31 // This class represents an item in overview mode.
31 class ASH_EXPORT WindowSelectorItem 32 class ASH_EXPORT WindowSelectorItem : public views::ButtonListener,
32 : public views::ButtonListener, 33 public aura::WindowObserver {
33 public aura::WindowObserver,
34 public TransparentActivateWindowButtonDelegate {
35 public: 34 public:
36 explicit WindowSelectorItem(aura::Window* window); 35 explicit WindowSelectorItem(aura::Window* window);
37 ~WindowSelectorItem() override; 36 ~WindowSelectorItem() override;
38 37
39 aura::Window* GetWindow(); 38 aura::Window* GetWindow();
40 39
41 // Returns the root window on which this item is shown. 40 // Returns the root window on which this item is shown.
42 aura::Window* root_window() { return root_window_; } 41 aura::Window* root_window() { return root_window_; }
43 42
44 // Returns true if |target| is contained in this WindowSelectorItem. 43 // Returns true if |target| is contained in this WindowSelectorItem.
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 75
77 const gfx::Rect& target_bounds() const { return target_bounds_; } 76 const gfx::Rect& target_bounds() const { return target_bounds_; }
78 77
79 // views::ButtonListener: 78 // views::ButtonListener:
80 void ButtonPressed(views::Button* sender, const ui::Event& event) override; 79 void ButtonPressed(views::Button* sender, const ui::Event& event) override;
81 80
82 // aura::WindowObserver: 81 // aura::WindowObserver:
83 void OnWindowDestroying(aura::Window* window) override; 82 void OnWindowDestroying(aura::Window* window) override;
84 void OnWindowTitleChanged(aura::Window* window) override; 83 void OnWindowTitleChanged(aura::Window* window) override;
85 84
86 // ash::TransparentActivateWindowButtonDelegate:
87 void Select() override;
88
89 private: 85 private:
90 friend class WindowSelectorTest; 86 friend class WindowSelectorTest;
91 87
92 // Sets the bounds of this selector's items to |target_bounds| in 88 // Sets the bounds of this selector's items to |target_bounds| in
93 // |root_window_|. The bounds change will be animated as specified 89 // |root_window_|. The bounds change will be animated as specified
94 // by |animation_type|. 90 // by |animation_type|.
95 void SetItemBounds(const gfx::Rect& target_bounds, 91 void SetItemBounds(const gfx::Rect& target_bounds,
96 OverviewAnimationType animation_type); 92 OverviewAnimationType animation_type);
97 93
98 // Changes the opacity of all the windows the item owns. 94 // Changes the opacity of all the windows the item owns.
99 void SetOpacity(float opacity); 95 void SetOpacity(float opacity);
100 96
101 // Updates the window label's bounds to |target_bounds|. Will create a new
102 // window label and fade it in if it doesn't exist. The bounds change is
103 // animated as specified by the |animation_type|.
104 void UpdateWindowLabels(const gfx::Rect& target_bounds,
105 OverviewAnimationType animation_type);
106
107 // Initializes window_label_.
108 void CreateWindowLabel(const base::string16& title);
109
110 // Updates the bounds and accessibility names for all the transparent
111 // overlays.
112 void UpdateSelectorButtons();
113
114 // Updates the close button's bounds. Any change in bounds will be animated 97 // Updates the close button's bounds. Any change in bounds will be animated
115 // from the current bounds to the new bounds as per the |animation_type|. 98 // from the current bounds to the new bounds as per the |animation_type|.
116 void UpdateCloseButtonLayout(OverviewAnimationType animation_type); 99 void UpdateCloseButtonLayout(OverviewAnimationType animation_type);
117 100
118 // Updates the close buttons accessibility name. 101 // Updates the close buttons accessibility name.
119 void UpdateCloseButtonAccessibilityName(); 102 void UpdateCloseButtonAccessibilityName();
120 103
121 // True if the item is being shown in the overview, false if it's being 104 // True if the item is being shown in the overview, false if it's being
122 // filtered. 105 // filtered.
123 bool dimmed_; 106 bool dimmed_;
124 107
125 // The root window this item is being displayed on. 108 // The root window this item is being displayed on.
126 aura::Window* root_window_; 109 aura::Window* root_window_;
127 110
128 // The contained Window's wrapper. 111 // The contained Window's wrapper.
129 ScopedTransformOverviewWindow transform_window_; 112 ScopedTransformOverviewWindow transform_window_;
130 113
131 // The target bounds this selector item is fit within. 114 // The target bounds this selector item is fit within.
132 gfx::Rect target_bounds_; 115 gfx::Rect target_bounds_;
133 116
134 // True if running SetItemBounds. This prevents recursive calls resulting from 117 // True if running SetItemBounds. This prevents recursive calls resulting from
135 // the bounds update when calling ::wm::RecreateWindowLayers to copy 118 // the bounds update when calling ::wm::RecreateWindowLayers to copy
136 // a window layer for display on another monitor. 119 // a window layer for display on another monitor.
137 bool in_bounds_update_; 120 bool in_bounds_update_;
138 121
139 // Label under the window displaying its active tab name.
140 scoped_ptr<views::Widget> window_label_;
141
142 // View for the label under the window.
143 views::Label* window_label_view_;
144
145 // The close buttons widget container. 122 // The close buttons widget container.
146 views::Widget close_button_widget_; 123 views::Widget close_button_widget_;
147 124
148 // An easy to access close button for the window in this item. Owned by the 125 // An easy to access close button for the window in this item. Owned by the
149 // close_button_widget_. 126 // close_button_widget_.
150 views::ImageButton* close_button_; 127 views::ImageButton* close_button_;
151 128
152 // Transparent overlay that covers the entire bounds of the 129 // Button that handles window activation.
153 // WindowSelectorItem and is stacked in front of all windows but behind each 130 scoped_ptr<OverviewWindowButton> overview_window_button_;
154 // Windows' own TransparentActivateWindowButton.
155 scoped_ptr<TransparentActivateWindowButton>
156 selector_item_activate_window_button_;
157 131
158 DISALLOW_COPY_AND_ASSIGN(WindowSelectorItem); 132 DISALLOW_COPY_AND_ASSIGN(WindowSelectorItem);
159 }; 133 };
160 134
161 } // namespace ash 135 } // namespace ash
162 136
163 #endif // ASH_WM_OVERVIEW_WINDOW_SELECTOR_ITEM_H_ 137 #endif // ASH_WM_OVERVIEW_WINDOW_SELECTOR_ITEM_H_
OLDNEW
« no previous file with comments | « ash/wm/overview/transparent_activate_window_button_delegate.h ('k') | ash/wm/overview/window_selector_item.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698