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

Unified Diff: ash/shelf/shelf_layout_manager.cc

Issue 16900002: Added flag for alternate launcher settings (remaining changes to come). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated description and string Created 7 years, 6 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') | chrome/app/generated_resources.grd » ('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 28818ca378339d1820b948d8896b0fa4447a09bd..e50c6fb258663a295efa50695f68f5c24861b65a 100644
--- a/ash/shelf/shelf_layout_manager.cc
+++ b/ash/shelf/shelf_layout_manager.cc
@@ -70,6 +70,11 @@ bool IsDraggingTrayEnabled() {
return dragging_tray_allowed;
}
+int GetPreferredShelfSize() {
+ return ash::switches::UseAlternateShelfLayout() ?
+ ShelfLayoutManager::kShelfSize : kLauncherPreferredSize;
+}
+
} // namespace
// static
@@ -81,6 +86,9 @@ const int ShelfLayoutManager::kWorkspaceAreaAutoHideInset = 5;
// static
const int ShelfLayoutManager::kAutoHideSize = 3;
+// static
+const int ShelfLayoutManager::kShelfSize = 47;
+
// ShelfLayoutManager::AutoHideEventFilter -------------------------------------
// Notifies ShelfLayoutManager any time the mouse moves.
@@ -659,9 +667,9 @@ void ShelfLayoutManager::GetShelfSize(int* width, int* height) {
gfx::Size status_size(
shelf_->status_area_widget()->GetWindowBoundsInScreen().size());
if (IsHorizontalAlignment())
- *height = kLauncherPreferredSize;
+ *height = GetPreferredShelfSize();
else
- *width = kLauncherPreferredSize;
+ *width = GetPreferredShelfSize();
}
void ShelfLayoutManager::AdjustBoundsBasedOnAlignment(int inset,
@@ -713,7 +721,7 @@ void ShelfLayoutManager::CalculateTargetBounds(
gfx::Rect(available_bounds.x(), available_bounds.y(),
available_bounds.width(), shelf_height));
- int status_inset = std::max(0, kLauncherPreferredSize -
+ int status_inset = std::max(0, GetPreferredShelfSize() -
PrimaryAxisValue(status_size.height(), status_size.width()));
target_bounds->status_bounds_in_shelf = SelectValueForShelfAlignment(
@@ -780,7 +788,7 @@ void ShelfLayoutManager::UpdateTargetBoundsForGesture(
// changed since then, e.g. because the tray-menu was shown because of the
// drag), then allow the drag some resistance-free region at first to make
// sure the shelf sticks with the finger until the shelf is visible.
- resistance_free_region = kLauncherPreferredSize - kAutoHideSize;
+ resistance_free_region = GetPreferredShelfSize() - kAutoHideSize;
}
bool resist = SelectValueForShelfAlignment(
« no previous file with comments | « ash/shelf/shelf_layout_manager.h ('k') | chrome/app/generated_resources.grd » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698