OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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_SHELF_SHELF_LAYOUT_MANAGER_H_ | 5 #ifndef ASH_SHELF_SHELF_LAYOUT_MANAGER_H_ |
6 #define ASH_SHELF_SHELF_LAYOUT_MANAGER_H_ | 6 #define ASH_SHELF_SHELF_LAYOUT_MANAGER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 | 148 |
149 // Overridden from SnapLayoutManager: | 149 // Overridden from SnapLayoutManager: |
150 void OnWindowResized() override; | 150 void OnWindowResized() override; |
151 void SetChildBounds(aura::Window* child, | 151 void SetChildBounds(aura::Window* child, |
152 const gfx::Rect& requested_bounds) override; | 152 const gfx::Rect& requested_bounds) override; |
153 | 153 |
154 // Overridden from ash::ShellObserver: | 154 // Overridden from ash::ShellObserver: |
155 void OnLockStateChanged(bool locked) override; | 155 void OnLockStateChanged(bool locked) override; |
156 void OnShelfAlignmentChanged(WmWindow* root_window) override; | 156 void OnShelfAlignmentChanged(WmWindow* root_window) override; |
157 void OnShelfAutoHideBehaviorChanged(WmWindow* root_window) override; | 157 void OnShelfAutoHideBehaviorChanged(WmWindow* root_window) override; |
| 158 void OnPinnedStateChanged(WmWindow* pinned_window) override; |
158 | 159 |
159 // Overriden from aura::client::ActivationChangeObserver: | 160 // Overriden from aura::client::ActivationChangeObserver: |
160 void OnWindowActivated( | 161 void OnWindowActivated( |
161 aura::client::ActivationChangeObserver::ActivationReason reason, | 162 aura::client::ActivationChangeObserver::ActivationReason reason, |
162 aura::Window* gained_active, | 163 aura::Window* gained_active, |
163 aura::Window* lost_active) override; | 164 aura::Window* lost_active) override; |
164 | 165 |
165 // Overridden from ash::LockStateObserver: | 166 // Overridden from ash::LockStateObserver: |
166 void OnLockStateEvent(LockStateObserver::EventType event) override; | 167 void OnLockStateEvent(LockStateObserver::EventType event) override; |
167 | 168 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 gfx::Rect status_bounds_in_shelf; | 224 gfx::Rect status_bounds_in_shelf; |
224 gfx::Insets work_area_insets; | 225 gfx::Insets work_area_insets; |
225 }; | 226 }; |
226 | 227 |
227 struct State { | 228 struct State { |
228 State() | 229 State() |
229 : visibility_state(SHELF_VISIBLE), | 230 : visibility_state(SHELF_VISIBLE), |
230 auto_hide_state(SHELF_AUTO_HIDE_HIDDEN), | 231 auto_hide_state(SHELF_AUTO_HIDE_HIDDEN), |
231 window_state(wm::WORKSPACE_WINDOW_STATE_DEFAULT), | 232 window_state(wm::WORKSPACE_WINDOW_STATE_DEFAULT), |
232 is_screen_locked(false), | 233 is_screen_locked(false), |
233 is_adding_user_screen(false) {} | 234 is_adding_user_screen(false), |
| 235 is_pinned(false) {} |
234 | 236 |
235 // Returns true if the two states are considered equal. As | 237 // Returns true if the two states are considered equal. As |
236 // |auto_hide_state| only matters if |visibility_state| is | 238 // |auto_hide_state| only matters if |visibility_state| is |
237 // |SHELF_AUTO_HIDE|, Equals() ignores the |auto_hide_state| as | 239 // |SHELF_AUTO_HIDE|, Equals() ignores the |auto_hide_state| as |
238 // appropriate. | 240 // appropriate. |
239 bool Equals(const State& other) const { | 241 bool Equals(const State& other) const { |
240 return other.visibility_state == visibility_state && | 242 return other.visibility_state == visibility_state && |
241 (visibility_state != SHELF_AUTO_HIDE || | 243 (visibility_state != SHELF_AUTO_HIDE || |
242 other.auto_hide_state == auto_hide_state) && | 244 other.auto_hide_state == auto_hide_state) && |
243 other.window_state == window_state && | 245 other.window_state == window_state && |
244 other.is_screen_locked == is_screen_locked && | 246 other.is_screen_locked == is_screen_locked && |
245 other.is_adding_user_screen == is_adding_user_screen; | 247 other.is_adding_user_screen == is_adding_user_screen && |
| 248 other.is_pinned == is_pinned; |
246 } | 249 } |
247 | 250 |
248 ShelfVisibilityState visibility_state; | 251 ShelfVisibilityState visibility_state; |
249 ShelfAutoHideState auto_hide_state; | 252 ShelfAutoHideState auto_hide_state; |
250 wm::WorkspaceWindowState window_state; | 253 wm::WorkspaceWindowState window_state; |
251 bool is_screen_locked; | 254 bool is_screen_locked; |
252 bool is_adding_user_screen; | 255 bool is_adding_user_screen; |
| 256 bool is_pinned; |
253 }; | 257 }; |
254 | 258 |
255 // Sets the visibility of the shelf to |state|. | 259 // Sets the visibility of the shelf to |state|. |
256 void SetState(ShelfVisibilityState visibility_state); | 260 void SetState(ShelfVisibilityState visibility_state); |
257 | 261 |
258 // Updates the bounds and opacity of the shelf and status widgets. | 262 // Updates the bounds and opacity of the shelf and status widgets. |
259 // If |observer| is specified, it will be called back when the animations, if | 263 // If |observer| is specified, it will be called back when the animations, if |
260 // any, are complete. | 264 // any, are complete. |
261 void UpdateBoundsAndOpacity(const TargetBounds& target_bounds, | 265 void UpdateBoundsAndOpacity(const TargetBounds& target_bounds, |
262 bool animate, | 266 bool animate, |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
391 | 395 |
392 std::unique_ptr<RootWindowControllerObserverImpl> | 396 std::unique_ptr<RootWindowControllerObserverImpl> |
393 root_window_controller_observer_; | 397 root_window_controller_observer_; |
394 | 398 |
395 DISALLOW_COPY_AND_ASSIGN(ShelfLayoutManager); | 399 DISALLOW_COPY_AND_ASSIGN(ShelfLayoutManager); |
396 }; | 400 }; |
397 | 401 |
398 } // namespace ash | 402 } // namespace ash |
399 | 403 |
400 #endif // ASH_SHELF_SHELF_LAYOUT_MANAGER_H_ | 404 #endif // ASH_SHELF_SHELF_LAYOUT_MANAGER_H_ |
OLD | NEW |