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

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 (a11y 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
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..a353c3fb363dfe4a4967d6a33b221e7a294bbd27 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 button's accessibility name.
tdanderson 2017/01/16 23:43:30 I assume that "button" here refers to the ShieldBu
varkha 2017/01/17 17:39:05 Done.
+ void UpdateButtonAccessibilityName();
// Fades out a window caption when exiting overview mode.
void FadeOut(std::unique_ptr<views::Widget> widget);
@@ -222,24 +191,21 @@ class ASH_EXPORT WindowSelectorItem : public views::ButtonListener,
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.
+ // This Widget owns |caption_container_view_| and is shown above the
+ // |transform_window_|.
std::unique_ptr<views::Widget> window_label_;
tdanderson 2017/01/16 23:43:30 So |window_label_| owns |caption_container_view_|,
varkha 2017/01/17 17:39:05 Done.
// Shadow around the item in overview.
std::unique_ptr<::wm::Shadow> shadow_;
// Container view that owns |window_label_button_view_| and |close_button_|.
tdanderson 2017/01/16 23:43:30 nit: update |window_label_button_view_| to its new
varkha 2017/01/17 17:39:05 Done.
- // Only used with Material Design.
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.
+ views::Label* window_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.
+ // |caption_container_view_|.
OverviewCloseButton* close_button_;
// Pointer to the WindowSelector that owns the WindowGrid containing |this|.

Powered by Google App Engine
This is Rietveld 408576698