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

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

Issue 331643004: Update the window labels if they change in overview mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed Sky's comments Created 6 years, 6 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 ac57266c12266fba0482d92dc692c8e82dbdb17a..2cae6749572887de55d0cb18ad70759655e537e4 100644
--- a/ash/wm/overview/window_selector_item.h
+++ b/ash/wm/overview/window_selector_item.h
@@ -7,6 +7,7 @@
#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"
@@ -15,6 +16,7 @@ class Window;
}
namespace views {
+class Label;
class Widget;
}
@@ -24,7 +26,8 @@ class TransparentActivateWindowButton;
// 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();
@@ -83,6 +86,9 @@ class WindowSelectorItem : public views::ButtonListener {
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
@@ -106,6 +112,9 @@ class WindowSelectorItem : public views::ButtonListener {
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_;
@@ -124,6 +133,9 @@ class WindowSelectorItem : public views::ButtonListener {
// 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_;

Powered by Google App Engine
This is Rietveld 408576698