Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef ASH_WM_OVERVIEW_WINDOW_SELECTOR_ITEM_H_ | 5 #ifndef ASH_WM_OVERVIEW_WINDOW_SELECTOR_ITEM_H_ |
| 6 #define ASH_WM_OVERVIEW_WINDOW_SELECTOR_ITEM_H_ | 6 #define ASH_WM_OVERVIEW_WINDOW_SELECTOR_ITEM_H_ |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/memory/scoped_ptr.h" | |
| 9 #include "ui/gfx/rect.h" | 10 #include "ui/gfx/rect.h" |
| 11 #include "ui/views/widget/widget.h" | |
|
tdanderson
2014/04/10 22:37:12
You can forward-declare the Widget class here inst
Nina
2014/04/14 16:24:04
Done.
| |
| 10 | 12 |
| 11 namespace aura { | 13 namespace aura { |
| 12 class Window; | 14 class Window; |
| 13 } | 15 } |
| 14 | 16 |
| 15 namespace ash { | 17 namespace ash { |
| 16 | 18 |
| 17 // This class represents an item in overview mode. An item can have one or more | 19 // This class represents an item in overview mode. An item can have one or more |
| 18 // windows, of which only one can be activated by keyboard (i.e. alt+tab) but | 20 // windows, of which only one can be activated by keyboard (i.e. alt+tab) but |
| 19 // any can be selected with a pointer (touch or mouse). | 21 // any can be selected with a pointer (touch or mouse). |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 67 protected: | 69 protected: |
| 68 // Sets the bounds of this selector item to |target_bounds| in |root_window|. | 70 // Sets the bounds of this selector item to |target_bounds| in |root_window|. |
| 69 // If |animate| the windows are animated from their current location. | 71 // If |animate| the windows are animated from their current location. |
| 70 virtual void SetItemBounds(aura::Window* root_window, | 72 virtual void SetItemBounds(aura::Window* root_window, |
| 71 const gfx::Rect& target_bounds, | 73 const gfx::Rect& target_bounds, |
| 72 bool animate) = 0; | 74 bool animate) = 0; |
| 73 | 75 |
| 74 // Sets the bounds used by the selector item's windows. | 76 // Sets the bounds used by the selector item's windows. |
| 75 void set_bounds(const gfx::Rect& bounds) { bounds_ = bounds; } | 77 void set_bounds(const gfx::Rect& bounds) { bounds_ = bounds; } |
| 76 | 78 |
| 79 // Creates a label to display under the window selector item. | |
| 80 void UpdateWindowLabels(const gfx::Rect& target_bounds); | |
| 81 | |
| 82 // Returns the label name | |
|
tdanderson
2014/04/10 22:37:12
nit: . at end of comment.
Nina
2014/04/14 16:24:04
Done.
| |
| 83 virtual base::string16 GetLabelName() = 0; | |
| 84 | |
| 77 private: | 85 private: |
| 78 // The root window this item is being displayed on. | 86 // The root window this item is being displayed on. |
| 79 aura::Window* root_window_; | 87 aura::Window* root_window_; |
| 80 | 88 |
| 81 // The target bounds this selector item is fit within. | 89 // The target bounds this selector item is fit within. |
| 82 gfx::Rect target_bounds_; | 90 gfx::Rect target_bounds_; |
| 83 | 91 |
| 84 // The actual bounds of the window(s) for this item. The aspect ratio of | 92 // The actual bounds of the window(s) for this item. The aspect ratio of |
| 85 // window(s) are maintained so they may not fill the target_bounds_. | 93 // window(s) are maintained so they may not fill the target_bounds_. |
| 86 gfx::Rect bounds_; | 94 gfx::Rect bounds_; |
| 87 | 95 |
| 88 // True if running SetItemBounds. This prevents recursive calls resulting from | 96 // True if running SetItemBounds. This prevents recursive calls resulting from |
| 89 // the bounds update when calling ::wm::RecreateWindowLayers to copy | 97 // the bounds update when calling ::wm::RecreateWindowLayers to copy |
| 90 // a window layer for display on another monitor. | 98 // a window layer for display on another monitor. |
| 91 bool in_bounds_update_; | 99 bool in_bounds_update_; |
| 92 | 100 |
| 101 // Title to show under the label | |
|
tdanderson
2014/04/10 22:37:12
nit: . at end of comment
Nina
2014/04/14 16:24:04
Done.
| |
| 102 base::string16 item_title_; | |
|
tdanderson
2014/04/10 22:37:12
It doesn't look like this member variable is being
Nina
2014/04/14 16:24:04
Done.
| |
| 103 | |
| 104 // Label under the window with the tab name. | |
| 105 scoped_ptr<views::Widget> window_label_; | |
| 106 | |
| 93 DISALLOW_COPY_AND_ASSIGN(WindowSelectorItem); | 107 DISALLOW_COPY_AND_ASSIGN(WindowSelectorItem); |
| 94 }; | 108 }; |
| 95 | 109 |
| 96 } // namespace ash | 110 } // namespace ash |
| 97 | 111 |
| 98 #endif // ASH_WM_OVERVIEW_WINDOW_SELECTOR_ITEM_H_ | 112 #endif // ASH_WM_OVERVIEW_WINDOW_SELECTOR_ITEM_H_ |
| OLD | NEW |