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

Unified Diff: ash/system/cast/tray_cast.cc

Issue 1877543002: Revise the shelf alignment locking mechanism. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update and cleanup tests. 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/shell.cc ('k') | ash/system/chromeos/network/tray_network.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/cast/tray_cast.cc
diff --git a/ash/system/cast/tray_cast.cc b/ash/system/cast/tray_cast.cc
index 2767e86793863d5d550bdc544e5773ad26df65cb..fbbc8b5152a910239d80d3a2f13ca42a0d3a2d7f 100644
--- a/ash/system/cast/tray_cast.cc
+++ b/ash/system/cast/tray_cast.cc
@@ -6,6 +6,7 @@
#include "ash/session/session_state_delegate.h"
#include "ash/shelf/shelf_types.h"
+#include "ash/shelf/shelf_util.h"
#include "ash/shell.h"
#include "ash/system/chromeos/screen_security/screen_tray_item.h"
#include "ash/system/tray/fixed_sized_image_view.h"
@@ -357,16 +358,9 @@ CastTrayView::~CastTrayView() {
void CastTrayView::UpdateAlignment(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::kVertical
+ : views::BoxLayout::kHorizontal;
SetLayoutManager(new views::BoxLayout(layout, 0, 0, 0));
Layout();
}
« no previous file with comments | « ash/shell.cc ('k') | ash/system/chromeos/network/tray_network.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698