| 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 "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
| 9 #include "ash/wm/overview/scoped_transform_overview_window.h" | 9 #include "ash/wm/overview/scoped_transform_overview_window.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 // label is read. | 66 // label is read. |
| 67 void SendFocusAlert() const; | 67 void SendFocusAlert() const; |
| 68 | 68 |
| 69 // Sets if the item is dimmed in the overview. Changing the value will also | 69 // Sets if the item is dimmed in the overview. Changing the value will also |
| 70 // change the visibility of the transform windows. | 70 // change the visibility of the transform windows. |
| 71 void SetDimmed(bool dimmed); | 71 void SetDimmed(bool dimmed); |
| 72 bool dimmed() const { return dimmed_; } | 72 bool dimmed() const { return dimmed_; } |
| 73 | 73 |
| 74 const gfx::Rect& target_bounds() const { return target_bounds_; } | 74 const gfx::Rect& target_bounds() const { return target_bounds_; } |
| 75 | 75 |
| 76 // Called when a touch scroll begin event occurs on this selector item. |
| 77 void OnScrollBegin(); |
| 78 |
| 79 // Called when a touch scroll update event occurs on this selector item. |
| 80 void OnScrollUpdate(int delta_x); |
| 81 |
| 82 // Called when a touch scroll end event occurs on this selector item. This may |
| 83 // cause the window to be closed. |
| 84 void OnScrollEnd(int delta_x); |
| 85 |
| 86 // Called when a touch fling event occurs on this selector item. This may |
| 87 // cause the window to be closed. |
| 88 void OnFling(int delta_x, float velocity_x); |
| 89 |
| 76 // views::ButtonListener: | 90 // views::ButtonListener: |
| 77 void ButtonPressed(views::Button* sender, const ui::Event& event) override; | 91 void ButtonPressed(views::Button* sender, const ui::Event& event) override; |
| 78 | 92 |
| 79 // aura::WindowObserver: | 93 // aura::WindowObserver: |
| 80 void OnWindowDestroying(aura::Window* window) override; | 94 void OnWindowDestroying(aura::Window* window) override; |
| 81 void OnWindowTitleChanged(aura::Window* window) override; | 95 void OnWindowTitleChanged(aura::Window* window) override; |
| 82 | 96 |
| 83 private: | 97 private: |
| 84 friend class WindowSelectorTest; | 98 friend class WindowSelectorTest; |
| 85 | 99 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 99 // Creates the window label. | 113 // Creates the window label. |
| 100 void CreateWindowLabel(const base::string16& title); | 114 void CreateWindowLabel(const base::string16& title); |
| 101 | 115 |
| 102 // Updates the close button's bounds. Any change in bounds will be animated | 116 // Updates the close button's bounds. Any change in bounds will be animated |
| 103 // from the current bounds to the new bounds as per the |animation_type|. | 117 // from the current bounds to the new bounds as per the |animation_type|. |
| 104 void UpdateCloseButtonLayout(OverviewAnimationType animation_type); | 118 void UpdateCloseButtonLayout(OverviewAnimationType animation_type); |
| 105 | 119 |
| 106 // Updates the close buttons accessibility name. | 120 // Updates the close buttons accessibility name. |
| 107 void UpdateCloseButtonAccessibilityName(); | 121 void UpdateCloseButtonAccessibilityName(); |
| 108 | 122 |
| 123 // Animates the |transform_window_| back to it's original overview mode |
| 124 // position. |
| 125 void ResetScrolledWindow(); |
| 126 |
| 127 // Returns the minimum distance at which a scroll gesture will cause this |
| 128 // selector item to be closed. |
| 129 int GetMinimumCloseDistance() const; |
| 130 |
| 109 // True if the item is being shown in the overview, false if it's being | 131 // True if the item is being shown in the overview, false if it's being |
| 110 // filtered. | 132 // filtered. |
| 111 bool dimmed_; | 133 bool dimmed_; |
| 112 | 134 |
| 113 // The root window this item is being displayed on. | 135 // The root window this item is being displayed on. |
| 114 aura::Window* root_window_; | 136 aura::Window* root_window_; |
| 115 | 137 |
| 116 // The contained Window's wrapper. | 138 // The contained Window's wrapper. |
| 117 ScopedTransformOverviewWindow transform_window_; | 139 ScopedTransformOverviewWindow transform_window_; |
| 118 | 140 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 136 // An easy to access close button for the window in this item. Owned by the | 158 // An easy to access close button for the window in this item. Owned by the |
| 137 // close_button_widget_. | 159 // close_button_widget_. |
| 138 views::ImageButton* close_button_; | 160 views::ImageButton* close_button_; |
| 139 | 161 |
| 140 DISALLOW_COPY_AND_ASSIGN(WindowSelectorItem); | 162 DISALLOW_COPY_AND_ASSIGN(WindowSelectorItem); |
| 141 }; | 163 }; |
| 142 | 164 |
| 143 } // namespace ash | 165 } // namespace ash |
| 144 | 166 |
| 145 #endif // ASH_WM_OVERVIEW_WINDOW_SELECTOR_ITEM_H_ | 167 #endif // ASH_WM_OVERVIEW_WINDOW_SELECTOR_ITEM_H_ |
| OLD | NEW |