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

Unified Diff: ash/common/wm/overview/window_selector_item.h

Issue 2633643002: [ash-md] Reduces dimensions of texture layers in overview mode (Closed)
Patch Set: [ash-md] Reduces dimensions of texture layers in overview mode (test) Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/ash_strings.grd ('k') | ash/common/wm/overview/window_selector_item.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/wm/overview/window_selector_item.h
diff --git a/ash/common/wm/overview/window_selector_item.h b/ash/common/wm/overview/window_selector_item.h
index 65b4293e49afe73ba609d486794f0432facd2656..6511fb96b63f12ee003184fe1662d6ff1e445730 100644
--- a/ash/common/wm/overview/window_selector_item.h
+++ b/ash/common/wm/overview/window_selector_item.h
@@ -15,7 +15,7 @@
#include "ui/gfx/geometry/rect.h"
#include "ui/views/controls/button/button.h"
#include "ui/views/controls/button/image_button.h"
-#include "ui/views/controls/button/label_button.h"
+#include "ui/views/controls/label.h"
#include "ui/views/widget/widget.h"
namespace gfx {
@@ -39,32 +39,6 @@ class WmWindow;
class ASH_EXPORT WindowSelectorItem : public views::ButtonListener,
public WmWindowObserver {
public:
- class OverviewLabelButton : public views::LabelButton {
- public:
- OverviewLabelButton(views::ButtonListener* listener,
- const base::string16& text);
-
- ~OverviewLabelButton() override;
-
- // Makes sure that text is readable with |background_color|.
- void SetBackgroundColorHint(SkColor background_color);
-
- // Resets the listener so that the listener can go out of scope.
- void ResetListener() { listener_ = nullptr; }
-
- void set_padding(const gfx::Insets& padding) { padding_ = padding; }
-
- protected:
- // views::LabelButton:
- gfx::Rect GetChildAreaBounds() override;
-
- private:
- // Padding on all sides to correctly place the text inside the view.
- gfx::Insets padding_;
-
- DISALLOW_COPY_AND_ASSIGN(OverviewLabelButton);
- };
-
// An image button with a close window icon.
class OverviewCloseButton : public views::ImageButton {
public:
@@ -116,9 +90,8 @@ class ASH_EXPORT WindowSelectorItem : public views::ButtonListener,
OverviewAnimationType animation_type);
// Activates or deactivates selection depending on |selected|.
- // Currently does nothing unless Material Design is enabled. With Material
- // Design the item's caption is shown transparent in selected state and blends
- // with the selection widget.
+ // In selected state the item's caption is shown transparent and blends with
+ // the selection widget.
void SetSelected(bool selected);
// Sends an accessibility event indicating that this window became selected
@@ -169,10 +142,6 @@ class ASH_EXPORT WindowSelectorItem : public views::ButtonListener,
// Changes the opacity of all the windows the item owns.
void SetOpacity(float opacity);
- // Updates the window label bounds.
- void UpdateWindowLabel(const gfx::Rect& window_bounds,
- OverviewAnimationType animation_type);
-
// Creates the window label.
void CreateWindowLabel(const base::string16& title);
@@ -188,8 +157,8 @@ class ASH_EXPORT WindowSelectorItem : public views::ButtonListener,
// using |animation_type|.
void AnimateOpacity(float opacity, OverviewAnimationType animation_type);
- // Updates the close buttons accessibility name.
- void UpdateCloseButtonAccessibilityName();
+ // Updates the accessibility name to match the window title.
+ void UpdateAccessibilityName();
// Fades out a window caption when exiting overview mode.
void FadeOut(std::unique_ptr<views::Widget> widget);
@@ -221,25 +190,25 @@ class ASH_EXPORT WindowSelectorItem : public views::ButtonListener,
// when the item is selected.
bool selected_;
- // Label displaying its name (active tab for tabbed windows).
- // With Material Design this Widget owns |caption_container_view_| and is
- // shown above the |transform_window_|.
- // Otherwise it is shown under the window.
- std::unique_ptr<views::Widget> window_label_;
+ // A widget that covers the |transform_window_|. The widget has
+ // |caption_container_view_| as its contents view. The widget is backed by a
+ // NOT_DRAWN layer since most of its surface is transparent.
+ std::unique_ptr<views::Widget> item_widget_;
// Shadow around the item in overview.
std::unique_ptr<::wm::Shadow> shadow_;
- // Container view that owns |window_label_button_view_| and |close_button_|.
- // Only used with Material Design.
+ // Container view that owns a Button view covering the |transform_window_|.
+ // That button serves as an event shield to receive all events such as clicks
+ // targeting the |transform_window_| or the overview header above the window.
+ // The shield button owns |background_view_| which owns |label_view_|
+ // and |close_button_|.
CaptionContainerView* caption_container_view_;
- // View for the label below the window or (with material design) above it.
- OverviewLabelButton* window_label_button_view_;
+ // A View for the text label above the window owned by the |background_view_|.
+ views::Label* label_view_;
- // A close button for the window in this item. Owned by the
- // |caption_container_view_| with Material Design or by |close_button_widget_|
- // otherwise.
+ // A close button for the window in this item owned by the |background_view_|.
OverviewCloseButton* close_button_;
// Pointer to the WindowSelector that owns the WindowGrid containing |this|.
@@ -247,7 +216,8 @@ class ASH_EXPORT WindowSelectorItem : public views::ButtonListener,
WindowSelector* window_selector_;
// Pointer to a view that covers the original header and has rounded top
- // corners. This view can have its color and opacity animated.
+ // corners. This view can have its color and opacity animated. It has a layer
+ // which is the only textured layer used by the |item_widget_|.
RoundedContainerView* background_view_;
DISALLOW_COPY_AND_ASSIGN(WindowSelectorItem);
« no previous file with comments | « ash/ash_strings.grd ('k') | ash/common/wm/overview/window_selector_item.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698