| 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_WM_SHELF_LAYOUT_MANAGER_H_ | 5 #ifndef ASH_WM_SHELF_LAYOUT_MANAGER_H_ |
| 6 #define ASH_WM_SHELF_LAYOUT_MANAGER_H_ | 6 #define ASH_WM_SHELF_LAYOUT_MANAGER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "ash/ash_export.h" | 9 #include "ash/ash_export.h" |
| 10 #include "ash/launcher/launcher.h" | 10 #include "ash/launcher/launcher.h" |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 struct TargetBounds { | 143 struct TargetBounds { |
| 144 TargetBounds() : opacity(0.0f) {} | 144 TargetBounds() : opacity(0.0f) {} |
| 145 | 145 |
| 146 float opacity; | 146 float opacity; |
| 147 gfx::Rect launcher_bounds; | 147 gfx::Rect launcher_bounds; |
| 148 gfx::Rect status_bounds; | 148 gfx::Rect status_bounds; |
| 149 gfx::Insets work_area_insets; | 149 gfx::Insets work_area_insets; |
| 150 }; | 150 }; |
| 151 | 151 |
| 152 struct State { | 152 struct State { |
| 153 State() : visibility_state(VISIBLE), auto_hide_state(AUTO_HIDE_HIDDEN) {} | 153 State() : visibility_state(VISIBLE), |
| 154 auto_hide_state(AUTO_HIDE_HIDDEN), |
| 155 is_screen_locked(false) {} |
| 154 | 156 |
| 155 // Returns true if the two states are considered equal. As | 157 // Returns true if the two states are considered equal. As |
| 156 // |auto_hide_state| only matters if |visibility_state| is |AUTO_HIDE|, | 158 // |auto_hide_state| only matters if |visibility_state| is |AUTO_HIDE|, |
| 157 // Equals() ignores the |auto_hide_state| as appropriate. | 159 // Equals() ignores the |auto_hide_state| as appropriate. |
| 158 bool Equals(const State& other) const { | 160 bool Equals(const State& other) const { |
| 159 return other.visibility_state == visibility_state && | 161 return other.visibility_state == visibility_state && |
| 160 (visibility_state != AUTO_HIDE || | 162 (visibility_state != AUTO_HIDE || |
| 161 other.auto_hide_state == auto_hide_state); | 163 other.auto_hide_state == auto_hide_state) && |
| 164 other.is_screen_locked == is_screen_locked; |
| 162 } | 165 } |
| 163 | 166 |
| 164 VisibilityState visibility_state; | 167 VisibilityState visibility_state; |
| 165 AutoHideState auto_hide_state; | 168 AutoHideState auto_hide_state; |
| 169 bool is_screen_locked; |
| 166 }; | 170 }; |
| 167 | 171 |
| 168 // Sets the visibility of the shelf to |state|. | 172 // Sets the visibility of the shelf to |state|. |
| 169 void SetState(VisibilityState visibility_state); | 173 void SetState(VisibilityState visibility_state); |
| 170 | 174 |
| 171 // Stops any animations. | 175 // Stops any animations. |
| 172 void StopAnimating(); | 176 void StopAnimating(); |
| 173 | 177 |
| 174 // Calculates the target bounds assuming visibility of |visible|. | 178 // Calculates the target bounds assuming visibility of |visible|. |
| 175 void CalculateTargetBounds(const State& state, | 179 void CalculateTargetBounds(const State& state, |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 // trigger showing the launcher. | 227 // trigger showing the launcher. |
| 224 scoped_ptr<AutoHideEventFilter> event_filter_; | 228 scoped_ptr<AutoHideEventFilter> event_filter_; |
| 225 | 229 |
| 226 DISALLOW_COPY_AND_ASSIGN(ShelfLayoutManager); | 230 DISALLOW_COPY_AND_ASSIGN(ShelfLayoutManager); |
| 227 }; | 231 }; |
| 228 | 232 |
| 229 } // namespace internal | 233 } // namespace internal |
| 230 } // namespace ash | 234 } // namespace ash |
| 231 | 235 |
| 232 #endif // ASH_WM_SHELF_LAYOUT_MANAGER_H_ | 236 #endif // ASH_WM_SHELF_LAYOUT_MANAGER_H_ |
| OLD | NEW |