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

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

Issue 872113004: Modified OverviewMode's LabelButton bounds to cover the entire item. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed ignore_border_overlap from label_button as per msw suggestion. Created 5 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_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 "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
11 #include "base/memory/scoped_ptr.h" 11 #include "base/memory/scoped_ptr.h"
12 #include "ui/aura/scoped_window_targeter.h" 12 #include "ui/aura/scoped_window_targeter.h"
13 #include "ui/aura/window_observer.h" 13 #include "ui/aura/window_observer.h"
14 #include "ui/gfx/geometry/rect.h" 14 #include "ui/gfx/geometry/rect.h"
15 #include "ui/views/controls/button/button.h" 15 #include "ui/views/controls/button/button.h"
16 #include "ui/views/controls/button/image_button.h" 16 #include "ui/views/controls/button/image_button.h"
17 17
18 namespace aura { 18 namespace aura {
19 class Window; 19 class Window;
20 } 20 }
21 21
22 namespace views { 22 namespace views {
23 class LabelButton; 23 class LabelButton;
24 class Widget; 24 class Widget;
25 } 25 }
26 26
27 namespace ash { 27 namespace ash {
28 28
29 class OverviewWindowButton;
30
31 // This class represents an item in overview mode. 29 // This class represents an item in overview mode.
32 class ASH_EXPORT WindowSelectorItem : public views::ButtonListener, 30 class ASH_EXPORT WindowSelectorItem : public views::ButtonListener,
33 public aura::WindowObserver { 31 public aura::WindowObserver {
34 public: 32 public:
35 explicit WindowSelectorItem(aura::Window* window); 33 explicit WindowSelectorItem(aura::Window* window);
36 ~WindowSelectorItem() override; 34 ~WindowSelectorItem() override;
37 35
38 aura::Window* GetWindow(); 36 aura::Window* GetWindow();
39 37
40 // Returns the root window on which this item is shown. 38 // Returns the root window on which this item is shown.
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 85
88 // Sets the bounds of this selector's items to |target_bounds| in 86 // Sets the bounds of this selector's items to |target_bounds| in
89 // |root_window_|. The bounds change will be animated as specified 87 // |root_window_|. The bounds change will be animated as specified
90 // by |animation_type|. 88 // by |animation_type|.
91 void SetItemBounds(const gfx::Rect& target_bounds, 89 void SetItemBounds(const gfx::Rect& target_bounds,
92 OverviewAnimationType animation_type); 90 OverviewAnimationType animation_type);
93 91
94 // Changes the opacity of all the windows the item owns. 92 // Changes the opacity of all the windows the item owns.
95 void SetOpacity(float opacity); 93 void SetOpacity(float opacity);
96 94
95 // Updates the window label bounds.
96 void UpdateWindowLabel(const gfx::Rect& window_bounds,
97 OverviewAnimationType animation_type);
98
99 // Creates the window label.
100 void CreateWindowLabel(const base::string16& title);
101
97 // Updates the close button's bounds. Any change in bounds will be animated 102 // Updates the close button's bounds. Any change in bounds will be animated
98 // from the current bounds to the new bounds as per the |animation_type|. 103 // from the current bounds to the new bounds as per the |animation_type|.
99 void UpdateCloseButtonLayout(OverviewAnimationType animation_type); 104 void UpdateCloseButtonLayout(OverviewAnimationType animation_type);
100 105
101 // Updates the close buttons accessibility name. 106 // Updates the close buttons accessibility name.
102 void UpdateCloseButtonAccessibilityName(); 107 void UpdateCloseButtonAccessibilityName();
103 108
104 // True if the item is being shown in the overview, false if it's being 109 // True if the item is being shown in the overview, false if it's being
105 // filtered. 110 // filtered.
106 bool dimmed_; 111 bool dimmed_;
107 112
108 // The root window this item is being displayed on. 113 // The root window this item is being displayed on.
109 aura::Window* root_window_; 114 aura::Window* root_window_;
110 115
111 // The contained Window's wrapper. 116 // The contained Window's wrapper.
112 ScopedTransformOverviewWindow transform_window_; 117 ScopedTransformOverviewWindow transform_window_;
113 118
114 // The target bounds this selector item is fit within. 119 // The target bounds this selector item is fit within.
115 gfx::Rect target_bounds_; 120 gfx::Rect target_bounds_;
116 121
117 // True if running SetItemBounds. This prevents recursive calls resulting from 122 // True if running SetItemBounds. This prevents recursive calls resulting from
118 // the bounds update when calling ::wm::RecreateWindowLayers to copy 123 // the bounds update when calling ::wm::RecreateWindowLayers to copy
119 // a window layer for display on another monitor. 124 // a window layer for display on another monitor.
120 bool in_bounds_update_; 125 bool in_bounds_update_;
121 126
127 // Label under the window displaying its active tab name.
128 scoped_ptr<views::Widget> window_label_;
129
130 // View for the label under the window.
131 views::LabelButton* window_label_button_view_;
132
122 // The close buttons widget container. 133 // The close buttons widget container.
123 views::Widget close_button_widget_; 134 views::Widget close_button_widget_;
124 135
125 // An easy to access close button for the window in this item. Owned by the 136 // An easy to access close button for the window in this item. Owned by the
126 // close_button_widget_. 137 // close_button_widget_.
127 views::ImageButton* close_button_; 138 views::ImageButton* close_button_;
128 139
129 // Button that handles window activation.
130 scoped_ptr<OverviewWindowButton> overview_window_button_;
131
132 DISALLOW_COPY_AND_ASSIGN(WindowSelectorItem); 140 DISALLOW_COPY_AND_ASSIGN(WindowSelectorItem);
133 }; 141 };
134 142
135 } // namespace ash 143 } // namespace ash
136 144
137 #endif // ASH_WM_OVERVIEW_WINDOW_SELECTOR_ITEM_H_ 145 #endif // ASH_WM_OVERVIEW_WINDOW_SELECTOR_ITEM_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698