#include "base/compiler_specific.h"
#include "base/memory/scoped_ptr.h"
+#include "ui/aura/window_observer.h"
#include "ui/gfx/rect.h"
#include "ui/views/controls/button/button.h"
}
namespace views {
+class Label;
class Widget;
}
// This class represents an item in overview mode. An item can have one or more
// windows, of which only one can be activated by keyboard (i.e. alt+tab) but
// any can be selected with a pointer (touch or mouse).
-class WindowSelectorItem : public views::ButtonListener {
+class WindowSelectorItem : public views::ButtonListener,
+ public aura::WindowObserver {
public:
WindowSelectorItem();
virtual ~WindowSelectorItem();
// label is read.
void SendFocusAlert() const;
+ // Sets if the item is dimmed in the overview. Changing the value will also
+ // change the visibility of the transform windows.
+ virtual void SetDimmed(bool dimmed);
+ bool dimmed() const { return dimmed_; }
+
const gfx::Rect& bounds() const { return bounds_; }
const gfx::Rect& target_bounds() const { return target_bounds_; }
virtual void ButtonPressed(views::Button* sender,
const ui::Event& event) OVERRIDE;
+ // aura::WindowObserver:
+ virtual void OnWindowTitleChanged(aura::Window* window) OVERRIDE;
+
protected:
// Sets the bounds of this selector's items to |target_bounds| in
// |root_window|. If |animate| the windows are animated from their current
// Sets the bounds used by the selector item's windows.
void set_bounds(const gfx::Rect& bounds) { bounds_ = bounds; }
+ // Changes the opacity of all the windows the item owns.
+ virtual void SetOpacity(float opacity);
+
+ // True if the item is being shown in the overview, false if it's being
+ // filtered.
+ bool dimmed_;
+
private:
friend class WindowSelectorTest;
aura::Window* root_window,
bool animate);
+ // Initializes window_label_.
+ void CreateWindowLabel(const base::string16& title);
+
// The root window this item is being displayed on.
aura::Window* root_window_;
// Label under the window displaying its active tab name.
scoped_ptr<views::Widget> window_label_;
+ // View for the label under the window.
+ views::Label* window_label_view_;
+
// An easy to access close button for the window in this item.
scoped_ptr<views::Widget> close_button_;