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

Unified Diff: ash/wm/shelf_layout_manager.cc

Issue 10384217: Add left/right layout support for uber tray. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: UpdateWidgetSize when layout manager is changed for systemtray and add test. Created 8 years, 7 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/system/tray/tray_constants.cc ('k') | ash/wm/shelf_layout_manager_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/shelf_layout_manager.cc
diff --git a/ash/wm/shelf_layout_manager.cc b/ash/wm/shelf_layout_manager.cc
index f1cbdaa36c42166cf3f854c01c9514dd4359404b..ad751a4174d965e5b8b9b1d697ee9d71283f3cb3 100644
--- a/ash/wm/shelf_layout_manager.cc
+++ b/ash/wm/shelf_layout_manager.cc
@@ -193,6 +193,8 @@ void ShelfLayoutManager::SetAlignment(ShelfAlignment alignment) {
alignment_ = alignment;
if (launcher_)
launcher_->SetAlignment(alignment);
+ if (Shell::GetInstance()->tray())
+ Shell::GetInstance()->tray()->SetShelfAlignment(alignment);
LayoutShelf();
}
@@ -395,12 +397,10 @@ void ShelfLayoutManager::GetShelfSize(int* width, int* height) {
gfx::Rect status_bounds(status_->GetWindowScreenBounds());
gfx::Size launcher_size = launcher_ ?
launcher_widget()->GetContentsView()->GetPreferredSize() : gfx::Size();
- if (alignment_ == SHELF_ALIGNMENT_BOTTOM) {
+ if (alignment_ == SHELF_ALIGNMENT_BOTTOM)
*height = std::max(launcher_size.height(), status_bounds.height());
- } else {
- // TODO: include status when supports alignment.
- *width = launcher_size.width();
- }
+ else
+ *width = std::max(launcher_size.width(), status_bounds.width());
}
void ShelfLayoutManager::AdjustBoundsBasedOnAlignment(int inset,
« no previous file with comments | « ash/system/tray/tray_constants.cc ('k') | ash/wm/shelf_layout_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698