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

Unified Diff: ash/system/tray/tray_image_item.cc

Issue 1907363004: (Merge to M-51) Revise the shelf alignment locking mechanism. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2704
Patch Set: 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/system/tray/tray_background_view.cc ('k') | ash/system/tray/tray_item_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/tray/tray_image_item.cc
diff --git a/ash/system/tray/tray_image_item.cc b/ash/system/tray/tray_image_item.cc
index b7891c3f390e214ba23d56348749624802d78a6b..ba81d02b9a96017af51b267a3cf903028d15ff5c 100644
--- a/ash/system/tray/tray_image_item.cc
+++ b/ash/system/tray/tray_image_item.cc
@@ -4,6 +4,7 @@
#include "ash/system/tray/tray_image_item.h"
+#include "ash/shelf/shelf_util.h"
#include "ash/system/tray/system_tray.h"
#include "ash/system/tray/tray_item_view.h"
#include "ash/system/tray/tray_utils.h"
@@ -73,16 +74,9 @@ void TrayImageItem::DestroyDetailedView() {
void TrayImageItem::SetItemAlignment(ShelfAlignment alignment) {
// Center the item dependent on the orientation of the shelf.
- views::BoxLayout::Orientation layout = views::BoxLayout::kHorizontal;
- switch (alignment) {
- case ash::SHELF_ALIGNMENT_BOTTOM:
- layout = views::BoxLayout::kHorizontal;
- break;
- case ash::SHELF_ALIGNMENT_LEFT:
- case ash::SHELF_ALIGNMENT_RIGHT:
- layout = views::BoxLayout::kVertical;
- break;
- }
+ views::BoxLayout::Orientation layout = IsHorizontalAlignment(alignment)
+ ? views::BoxLayout::kHorizontal
+ : views::BoxLayout::kVertical;
tray_view_->SetLayoutManager(new views::BoxLayout(layout, 0, 0, 0));
tray_view_->Layout();
}
« no previous file with comments | « ash/system/tray/tray_background_view.cc ('k') | ash/system/tray/tray_item_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698