| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "ash/ash_export.h" | 10 #include "ash/ash_export.h" |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 // Clears internal data for shutdown process. | 115 // Clears internal data for shutdown process. |
| 116 void PrepareForShutdown(); | 116 void PrepareForShutdown(); |
| 117 | 117 |
| 118 // Returns whether the shelf and its contents (launcher, status) are visible | 118 // Returns whether the shelf and its contents (launcher, status) are visible |
| 119 // on the screen. | 119 // on the screen. |
| 120 bool IsVisible() const; | 120 bool IsVisible() const; |
| 121 | 121 |
| 122 // Returns the ideal bounds of the shelf assuming it is visible. | 122 // Returns the ideal bounds of the shelf assuming it is visible. |
| 123 gfx::Rect GetIdealBounds(); | 123 gfx::Rect GetIdealBounds(); |
| 124 | 124 |
| 125 // Returns the docked area bounds. |
| 126 const gfx::Rect& dock_bounds() const { return dock_bounds_; } |
| 127 |
| 125 // Stops any animations and sets the bounds of the launcher and status | 128 // Stops any animations and sets the bounds of the launcher and status |
| 126 // widgets. | 129 // widgets. |
| 127 void LayoutShelf(); | 130 void LayoutShelf(); |
| 128 | 131 |
| 129 // Returns shelf visibility state based on current value of auto hide | 132 // Returns shelf visibility state based on current value of auto hide |
| 130 // behavior setting. | 133 // behavior setting. |
| 131 ShelfVisibilityState CalculateShelfVisibility(); | 134 ShelfVisibilityState CalculateShelfVisibility(); |
| 132 | 135 |
| 133 // Updates the visibility state. | 136 // Updates the visibility state. |
| 134 void UpdateVisibilityState(); | 137 void UpdateVisibilityState(); |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 void AdjustBoundsBasedOnAlignment(int inset, gfx::Rect* bounds) const; | 288 void AdjustBoundsBasedOnAlignment(int inset, gfx::Rect* bounds) const; |
| 286 | 289 |
| 287 // Calculates the target bounds assuming visibility of |visible|. | 290 // Calculates the target bounds assuming visibility of |visible|. |
| 288 void CalculateTargetBounds(const State& state, TargetBounds* target_bounds); | 291 void CalculateTargetBounds(const State& state, TargetBounds* target_bounds); |
| 289 | 292 |
| 290 // Updates the target bounds if a gesture-drag is in progress. This is only | 293 // Updates the target bounds if a gesture-drag is in progress. This is only |
| 291 // used by |CalculateTargetBounds()|. | 294 // used by |CalculateTargetBounds()|. |
| 292 void UpdateTargetBoundsForGesture(TargetBounds* target_bounds) const; | 295 void UpdateTargetBoundsForGesture(TargetBounds* target_bounds) const; |
| 293 | 296 |
| 294 // Updates the background of the shelf. | 297 // Updates the background of the shelf. |
| 295 void UpdateShelfBackground(BackgroundAnimator::ChangeType type); | 298 void UpdateShelfBackground(BackgroundAnimatorChangeType type); |
| 296 | 299 |
| 297 // Returns how the shelf background is painted. | 300 // Returns how the shelf background is painted. |
| 298 ShelfBackgroundType GetShelfBackgroundType() const; | 301 ShelfBackgroundType GetShelfBackgroundType() const; |
| 299 | 302 |
| 300 // Updates the auto hide state immediately. | 303 // Updates the auto hide state immediately. |
| 301 void UpdateAutoHideStateNow(); | 304 void UpdateAutoHideStateNow(); |
| 302 | 305 |
| 303 // Stops the auto hide timer and clears | 306 // Stops the auto hide timer and clears |
| 304 // |mouse_over_shelf_when_auto_hide_timer_started_|. | 307 // |mouse_over_shelf_when_auto_hide_timer_started_|. |
| 305 void StopAutoHideTimer(); | 308 void StopAutoHideTimer(); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 324 int GetWorkAreaSize(const State& state, int size) const; | 327 int GetWorkAreaSize(const State& state, int size) const; |
| 325 | 328 |
| 326 // Return the bounds available in the parent, taking into account the bounds | 329 // Return the bounds available in the parent, taking into account the bounds |
| 327 // of the keyboard if necessary. | 330 // of the keyboard if necessary. |
| 328 gfx::Rect GetAvailableBounds() const; | 331 gfx::Rect GetAvailableBounds() const; |
| 329 | 332 |
| 330 // Overridden from keyboard::KeyboardControllerObserver: | 333 // Overridden from keyboard::KeyboardControllerObserver: |
| 331 virtual void OnKeyboardBoundsChanging( | 334 virtual void OnKeyboardBoundsChanging( |
| 332 const gfx::Rect& keyboard_bounds) OVERRIDE; | 335 const gfx::Rect& keyboard_bounds) OVERRIDE; |
| 333 | 336 |
| 334 // Overridden from dock::DockObserver: | 337 // Overridden from DockedWindowLayoutManagerObserver: |
| 335 virtual void OnDockBoundsChanging( | 338 virtual void OnDockBoundsChanging( |
| 336 const gfx::Rect& dock_bounds, | 339 const gfx::Rect& dock_bounds, |
| 337 DockedWindowLayoutManagerObserver::Reason reason) OVERRIDE; | 340 DockedWindowLayoutManagerObserver::Reason reason) OVERRIDE; |
| 338 | 341 |
| 339 // Generates insets for inward edge based on the current shelf alignment. | 342 // Generates insets for inward edge based on the current shelf alignment. |
| 340 gfx::Insets GetInsetsForAlignment(int distance) const; | 343 gfx::Insets GetInsetsForAlignment(int distance) const; |
| 341 | 344 |
| 342 // The RootWindow is cached so that we don't invoke Shell::GetInstance() from | 345 // The RootWindow is cached so that we don't invoke Shell::GetInstance() from |
| 343 // our destructor. We avoid that as at the time we're deleted Shell is being | 346 // our destructor. We avoid that as at the time we're deleted Shell is being |
| 344 // deleted too. | 347 // deleted too. |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 407 // The bounds of the dock. | 410 // The bounds of the dock. |
| 408 gfx::Rect dock_bounds_; | 411 gfx::Rect dock_bounds_; |
| 409 | 412 |
| 410 DISALLOW_COPY_AND_ASSIGN(ShelfLayoutManager); | 413 DISALLOW_COPY_AND_ASSIGN(ShelfLayoutManager); |
| 411 }; | 414 }; |
| 412 | 415 |
| 413 } // namespace internal | 416 } // namespace internal |
| 414 } // namespace ash | 417 } // namespace ash |
| 415 | 418 |
| 416 #endif // ASH_SHELF_SHELF_LAYOUT_MANAGER_H_ | 419 #endif // ASH_SHELF_SHELF_LAYOUT_MANAGER_H_ |
| OLD | NEW |