Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(55)

Side by Side Diff: ash/shelf/shelf_layout_manager.h

Issue 1914093002: Refactors DockedWindowLayoutManager in terms of ash/wm/common (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@nuke_aura_window
Patch Set: comment Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ash/shelf/shelf_constants.cc ('k') | ash/shelf/shelf_layout_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 173
174 // TODO(msw): Remove these accessors, kept temporarily to simplify changes. 174 // TODO(msw): Remove these accessors, kept temporarily to simplify changes.
175 void SetAutoHideBehavior(ShelfAutoHideBehavior behavior) { 175 void SetAutoHideBehavior(ShelfAutoHideBehavior behavior) {
176 shelf_->shelf()->SetAutoHideBehavior(behavior); 176 shelf_->shelf()->SetAutoHideBehavior(behavior);
177 } 177 }
178 ShelfAutoHideBehavior auto_hide_behavior() const { 178 ShelfAutoHideBehavior auto_hide_behavior() const {
179 return shelf_->shelf()->GetAutoHideBehavior(); 179 return shelf_->shelf()->GetAutoHideBehavior();
180 } 180 }
181 181
182 // TODO(msw): Remove these accessors, kept temporarily to simplify changes. 182 // TODO(msw): Remove these accessors, kept temporarily to simplify changes.
183 void SetAlignment(ShelfAlignment alignment) { 183 void SetAlignment(wm::ShelfAlignment alignment) {
184 shelf_->shelf()->SetAlignment(alignment); 184 shelf_->shelf()->SetAlignment(alignment);
185 } 185 }
186 ShelfAlignment GetAlignment() const { return shelf_->GetAlignment(); } 186 wm::ShelfAlignment GetAlignment() const { return shelf_->GetAlignment(); }
187 187
188 // TODO(harrym|oshima): These templates will be moved to a new Shelf class. 188 // TODO(harrym|oshima): These templates will be moved to a new Shelf class.
189 // A helper function for choosing values specific to a shelf alignment. 189 // A helper function for choosing values specific to a shelf alignment.
190 template <typename T> 190 template <typename T>
191 T SelectValueForShelfAlignment(T bottom, T left, T right) const { 191 T SelectValueForShelfAlignment(T bottom, T left, T right) const {
192 switch (GetAlignment()) { 192 switch (GetAlignment()) {
193 case SHELF_ALIGNMENT_BOTTOM: 193 case wm::SHELF_ALIGNMENT_BOTTOM:
194 case SHELF_ALIGNMENT_BOTTOM_LOCKED: 194 case wm::SHELF_ALIGNMENT_BOTTOM_LOCKED:
195 return bottom; 195 return bottom;
196 case SHELF_ALIGNMENT_LEFT: 196 case wm::SHELF_ALIGNMENT_LEFT:
197 return left; 197 return left;
198 case SHELF_ALIGNMENT_RIGHT: 198 case wm::SHELF_ALIGNMENT_RIGHT:
199 return right; 199 return right;
200 } 200 }
201 NOTREACHED(); 201 NOTREACHED();
202 return right; 202 return right;
203 } 203 }
204 204
205 template<typename T> 205 template<typename T>
206 T PrimaryAxisValue(T horizontal, T vertical) const { 206 T PrimaryAxisValue(T horizontal, T vertical) const {
207 return IsHorizontalAlignment() ? horizontal : vertical; 207 return IsHorizontalAlignment() ? horizontal : vertical;
208 } 208 }
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 void CalculateTargetBounds(const State& state, TargetBounds* target_bounds); 282 void CalculateTargetBounds(const State& state, TargetBounds* target_bounds);
283 283
284 // Updates the target bounds if a gesture-drag is in progress. This is only 284 // Updates the target bounds if a gesture-drag is in progress. This is only
285 // used by |CalculateTargetBounds()|. 285 // used by |CalculateTargetBounds()|.
286 void UpdateTargetBoundsForGesture(TargetBounds* target_bounds) const; 286 void UpdateTargetBoundsForGesture(TargetBounds* target_bounds) const;
287 287
288 // Updates the background of the shelf. 288 // Updates the background of the shelf.
289 void UpdateShelfBackground(BackgroundAnimatorChangeType type); 289 void UpdateShelfBackground(BackgroundAnimatorChangeType type);
290 290
291 // Returns how the shelf background is painted. 291 // Returns how the shelf background is painted.
292 ShelfBackgroundType GetShelfBackgroundType() const; 292 wm::ShelfBackgroundType GetShelfBackgroundType() const;
293 293
294 // Updates the auto hide state immediately. 294 // Updates the auto hide state immediately.
295 void UpdateAutoHideStateNow(); 295 void UpdateAutoHideStateNow();
296 296
297 // Stops the auto hide timer and clears 297 // Stops the auto hide timer and clears
298 // |mouse_over_shelf_when_auto_hide_timer_started_|. 298 // |mouse_over_shelf_when_auto_hide_timer_started_|.
299 void StopAutoHideTimer(); 299 void StopAutoHideTimer();
300 300
301 // Returns the bounds of an additional region which can trigger showing the 301 // Returns the bounds of an additional region which can trigger showing the
302 // shelf. This region exists to make it easier to trigger showing the shelf 302 // shelf. This region exists to make it easier to trigger showing the shelf
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 397
398 // The show hide animation duration override or 0 for default. 398 // The show hide animation duration override or 0 for default.
399 int duration_override_in_ms_; 399 int duration_override_in_ms_;
400 400
401 DISALLOW_COPY_AND_ASSIGN(ShelfLayoutManager); 401 DISALLOW_COPY_AND_ASSIGN(ShelfLayoutManager);
402 }; 402 };
403 403
404 } // namespace ash 404 } // namespace ash
405 405
406 #endif // ASH_SHELF_SHELF_LAYOUT_MANAGER_H_ 406 #endif // ASH_SHELF_SHELF_LAYOUT_MANAGER_H_
OLDNEW
« no previous file with comments | « ash/shelf/shelf_constants.cc ('k') | ash/shelf/shelf_layout_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698