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

Unified 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: Reworked LabelButton changes. 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 side-by-side diff with in-line comments
Download patch
Index: ash/wm/overview/window_selector_item.h
diff --git a/ash/wm/overview/window_selector_item.h b/ash/wm/overview/window_selector_item.h
index 30157cc8a5cfd439b8b64e4eea605e6fab9d797c..8f356f5ca5db591a773f9b8ee085dc253a8545f9 100644
--- a/ash/wm/overview/window_selector_item.h
+++ b/ash/wm/overview/window_selector_item.h
@@ -14,6 +14,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"
namespace aura {
class Window;
@@ -26,12 +27,27 @@ class Widget;
namespace ash {
-class OverviewWindowButton;
-
// This class represents an item in overview mode.
class ASH_EXPORT WindowSelectorItem : public views::ButtonListener,
public aura::WindowObserver {
public:
+ class OverviewLabelButton : public views::LabelButton {
+ public:
+ OverviewLabelButton(views::ButtonListener* listener,
+ const base::string16& text);
+
+ ~OverviewLabelButton() override {}
msw 2015/02/09 23:45:27 nit: don't define this virtual dtor inline in the
+
+ void set_top_padding(int top_padding) { top_padding_ = top_padding; }
+
+ protected:
+ gfx::Rect GetChildAreaBounds() override;
msw 2015/02/09 23:45:27 nit: add the overrides section comment: "// views:
+
+ private:
+ // Padding on top of the button.
+ int top_padding_;
+ };
msw 2015/02/09 23:45:27 nit: DISALLOW_COPY_AND_ASSIGN(OverviewLabelButton)
+
explicit WindowSelectorItem(aura::Window* window);
~WindowSelectorItem() override;
@@ -94,6 +110,13 @@ 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);
+
// Updates the close button's bounds. Any change in bounds will be animated
// from the current bounds to the new bounds as per the |animation_type|.
void UpdateCloseButtonLayout(OverviewAnimationType animation_type);
@@ -119,6 +142,12 @@ class ASH_EXPORT WindowSelectorItem : public views::ButtonListener,
// a window layer for display on another monitor.
bool in_bounds_update_;
+ // Label under the window displaying its active tab name.
+ scoped_ptr<views::Widget> window_label_;
+
+ // View for the label under the window.
+ OverviewLabelButton* window_label_button_view_;
+
// The close buttons widget container.
views::Widget close_button_widget_;
@@ -126,9 +155,6 @@ class ASH_EXPORT WindowSelectorItem : public views::ButtonListener,
// close_button_widget_.
views::ImageButton* close_button_;
- // Button that handles window activation.
- scoped_ptr<OverviewWindowButton> overview_window_button_;
-
DISALLOW_COPY_AND_ASSIGN(WindowSelectorItem);
};

Powered by Google App Engine
This is Rietveld 408576698