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

Unified Diff: ash/shelf/shelf_layout_manager.cc

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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/shelf/shelf_layout_manager.h ('k') | ash/shelf/shelf_layout_manager_observer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/shelf/shelf_layout_manager.cc
diff --git a/ash/shelf/shelf_layout_manager.cc b/ash/shelf/shelf_layout_manager.cc
index 88be2c2085559d37f35974066e3bf4fdfc77951e..9bc695ac525ae1f1c1148a25be4e1a3d20270ca3 100644
--- a/ash/shelf/shelf_layout_manager.cc
+++ b/ash/shelf/shelf_layout_manager.cc
@@ -388,12 +388,12 @@ void ShelfLayoutManager::CompleteGestureDrag(const ui::GestureEvent& gesture) {
} else {
bool correct_direction = false;
switch (GetAlignment()) {
- case SHELF_ALIGNMENT_BOTTOM:
- case SHELF_ALIGNMENT_BOTTOM_LOCKED:
- case SHELF_ALIGNMENT_RIGHT:
+ case wm::SHELF_ALIGNMENT_BOTTOM:
+ case wm::SHELF_ALIGNMENT_BOTTOM_LOCKED:
+ case wm::SHELF_ALIGNMENT_RIGHT:
correct_direction = gesture_drag_amount_ < 0;
break;
- case SHELF_ALIGNMENT_LEFT:
+ case wm::SHELF_ALIGNMENT_LEFT:
correct_direction = gesture_drag_amount_ > 0;
break;
}
@@ -846,7 +846,7 @@ void ShelfLayoutManager::UpdateTargetBoundsForGesture(
} else {
// Move and size the shelf with the gesture.
int shelf_width = target_bounds->shelf_bounds_in_root.width();
- bool right_aligned = GetAlignment() == SHELF_ALIGNMENT_RIGHT;
+ bool right_aligned = GetAlignment() == wm::SHELF_ALIGNMENT_RIGHT;
if (right_aligned)
shelf_width -= translate;
else
@@ -869,26 +869,26 @@ void ShelfLayoutManager::UpdateTargetBoundsForGesture(
void ShelfLayoutManager::UpdateShelfBackground(
BackgroundAnimatorChangeType type) {
- const ShelfBackgroundType background_type(GetShelfBackgroundType());
+ const wm::ShelfBackgroundType background_type(GetShelfBackgroundType());
shelf_->SetPaintsBackground(background_type, type);
FOR_EACH_OBSERVER(ShelfLayoutManagerObserver, observers_,
OnBackgroundUpdated(background_type, type));
}
-ShelfBackgroundType ShelfLayoutManager::GetShelfBackgroundType() const {
+wm::ShelfBackgroundType ShelfLayoutManager::GetShelfBackgroundType() const {
if (state_.visibility_state != SHELF_AUTO_HIDE &&
state_.window_state == wm::WORKSPACE_WINDOW_STATE_MAXIMIZED) {
- return SHELF_BACKGROUND_MAXIMIZED;
+ return wm::SHELF_BACKGROUND_MAXIMIZED;
}
if (gesture_drag_status_ == GESTURE_DRAG_IN_PROGRESS ||
(!state_.is_screen_locked && !state_.is_adding_user_screen &&
window_overlaps_shelf_) ||
(state_.visibility_state == SHELF_AUTO_HIDE)) {
- return SHELF_BACKGROUND_OVERLAP;
+ return wm::SHELF_BACKGROUND_OVERLAP;
}
- return SHELF_BACKGROUND_DEFAULT;
+ return wm::SHELF_BACKGROUND_DEFAULT;
}
void ShelfLayoutManager::UpdateAutoHideStateNow() {
@@ -990,11 +990,13 @@ ShelfAutoHideState ShelfLayoutManager::CalculateAutoHideState(
IsVisible()) {
// Increase the the hit test area to prevent the shelf from disappearing
// when the mouse is over the bubble gap.
- ShelfAlignment alignment = GetAlignment();
+ wm::ShelfAlignment alignment = GetAlignment();
shelf_region.Inset(
- alignment == SHELF_ALIGNMENT_RIGHT ? -kNotificationBubbleGapHeight : 0,
+ alignment == wm::SHELF_ALIGNMENT_RIGHT ? -kNotificationBubbleGapHeight
+ : 0,
IsHorizontalAlignment() ? -kNotificationBubbleGapHeight : 0,
- alignment == SHELF_ALIGNMENT_LEFT ? -kNotificationBubbleGapHeight : 0,
+ alignment == wm::SHELF_ALIGNMENT_LEFT ? -kNotificationBubbleGapHeight
+ : 0,
0);
}
« no previous file with comments | « ash/shelf/shelf_layout_manager.h ('k') | ash/shelf/shelf_layout_manager_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698