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

Unified Diff: ash/system/chromeos/screen_security/screen_tray_item.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
Index: ash/system/chromeos/screen_security/screen_tray_item.cc
diff --git a/ash/system/chromeos/screen_security/screen_tray_item.cc b/ash/system/chromeos/screen_security/screen_tray_item.cc
index ab8b0033ea30e7aee0d36adc46df72ae9b81d469..8d5be35f0636257c357fb5ee2bce395d7f9221a3 100644
--- a/ash/system/chromeos/screen_security/screen_tray_item.cc
+++ b/ash/system/chromeos/screen_security/screen_tray_item.cc
@@ -4,6 +4,7 @@
#include "ash/system/chromeos/screen_security/screen_tray_item.h"
+#include "ash/shelf/shelf_util.h"
#include "ash/system/tray/fixed_sized_image_view.h"
#include "ash/system/tray/tray_constants.h"
#include "ui/base/resource/resource_bundle.h"
@@ -187,9 +188,9 @@ void ScreenTrayItem::UpdateAfterShelfAlignmentChange(ShelfAlignment alignment) {
return;
// Center the item dependent on the orientation of the shelf.
- views::BoxLayout::Orientation layout =
- alignment == ash::SHELF_ALIGNMENT_BOTTOM ? views::BoxLayout::kHorizontal
- : views::BoxLayout::kVertical;
+ 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/chromeos/network/tray_network.cc ('k') | ash/system/chromeos/virtual_keyboard/virtual_keyboard_tray.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698