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

Unified Diff: ash/system/status_area_widget_delegate.cc

Issue 2807693002: Make LogoutButtonTray a regular View (Closed)
Patch Set: Rebased Created 3 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/status_area_widget_delegate.cc
diff --git a/ash/system/status_area_widget_delegate.cc b/ash/system/status_area_widget_delegate.cc
index 9a969403b3db218449e96f7fbe51e1669f6250b4..5b63cb4446c4f919c0cddff9ea4c666a23c77439 100644
--- a/ash/system/status_area_widget_delegate.cc
+++ b/ash/system/status_area_widget_delegate.cc
@@ -8,7 +8,6 @@
#include "ash/root_window_controller.h"
#include "ash/shelf/shelf_constants.h"
#include "ash/shelf/wm_shelf.h"
-#include "ash/shelf/wm_shelf_util.h"
#include "ash/shell.h"
#include "ash/system/tray/tray_constants.h"
#include "ash/wm_window.h"
@@ -46,8 +45,10 @@ class StatusAreaWidgetDelegateAnimationSettings
namespace ash {
-StatusAreaWidgetDelegate::StatusAreaWidgetDelegate()
- : focus_cycler_for_testing_(nullptr), alignment_(SHELF_ALIGNMENT_BOTTOM) {
+StatusAreaWidgetDelegate::StatusAreaWidgetDelegate(WmShelf* wm_shelf)
+ : wm_shelf_(wm_shelf), focus_cycler_for_testing_(nullptr) {
+ DCHECK(wm_shelf_);
+
// Allow the launcher to surrender the focus to another window upon
// navigation completion by the user.
set_allow_deactivate_on_esc(true);
@@ -121,7 +122,7 @@ void StatusAreaWidgetDelegate::UpdateLayout() {
views::ColumnSet* columns = layout->AddColumnSet(0);
- if (IsHorizontalAlignment(alignment_)) {
+ if (wm_shelf_->IsHorizontalAlignment()) {
for (int c = child_count() - 1; c >= 0; --c) {
views::View* child = child_at(c);
if (!child->visible())
@@ -174,7 +175,7 @@ void StatusAreaWidgetDelegate::UpdateWidgetSize() {
void StatusAreaWidgetDelegate::SetBorderOnChild(views::View* child,
bool extend_border_to_edge) {
// Tray views are laid out right-to-left or bottom-to-top.
- const bool horizontal_alignment = IsHorizontalAlignment(alignment_);
+ const bool horizontal_alignment = wm_shelf_->IsHorizontalAlignment();
const int padding = (GetShelfConstant(SHELF_SIZE) - kTrayItemSize) / 2;
const int top_edge = horizontal_alignment ? padding : 0;

Powered by Google App Engine
This is Rietveld 408576698