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

Side by Side Diff: ash/common/system/chromeos/session/logout_button_tray.cc

Issue 2103113003: Fix shelf layout when switching from left-aligned shelf to right-aligned shelf (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/common/system/chromeos/session/logout_button_tray.h" 5 #include "ash/common/system/chromeos/session/logout_button_tray.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "ash/common/shelf/shelf_types.h" 10 #include "ash/common/shelf/shelf_types.h"
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 button_ = new LogoutButton(this); 101 button_ = new LogoutButton(this);
102 tray_container()->AddChildView(button_); 102 tray_container()->AddChildView(button_);
103 tray_container()->SetBorder(views::Border::NullBorder()); 103 tray_container()->SetBorder(views::Border::NullBorder());
104 WmShell::Get()->system_tray_notifier()->AddLogoutButtonObserver(this); 104 WmShell::Get()->system_tray_notifier()->AddLogoutButtonObserver(this);
105 } 105 }
106 106
107 LogoutButtonTray::~LogoutButtonTray() { 107 LogoutButtonTray::~LogoutButtonTray() {
108 WmShell::Get()->system_tray_notifier()->RemoveLogoutButtonObserver(this); 108 WmShell::Get()->system_tray_notifier()->RemoveLogoutButtonObserver(this);
109 } 109 }
110 110
111 void LogoutButtonTray::SetShelfAlignment(ShelfAlignment alignment) { 111 void LogoutButtonTray::SetShelfAlignment(ShelfAlignment alignment,
112 TrayBackgroundView::SetShelfAlignment(alignment); 112 const gfx::Insets& insets) {
113 TrayBackgroundView::SetShelfAlignment(alignment, insets);
113 tray_container()->SetBorder(views::Border::NullBorder()); 114 tray_container()->SetBorder(views::Border::NullBorder());
114 } 115 }
115 116
116 base::string16 LogoutButtonTray::GetAccessibleNameForTray() { 117 base::string16 LogoutButtonTray::GetAccessibleNameForTray() {
117 return button_->GetText(); 118 return button_->GetText();
118 } 119 }
119 120
120 void LogoutButtonTray::HideBubbleWithView( 121 void LogoutButtonTray::HideBubbleWithView(
121 const views::TrayBubbleView* bubble_view) {} 122 const views::TrayBubbleView* bubble_view) {}
122 123
(...skipping 29 matching lines...) Expand all
152 UpdateVisibility(); 153 UpdateVisibility();
153 } 154 }
154 155
155 void LogoutButtonTray::UpdateVisibility() { 156 void LogoutButtonTray::UpdateVisibility() {
156 SetVisible(show_logout_button_in_tray_ && 157 SetVisible(show_logout_button_in_tray_ &&
157 login_status_ != LoginStatus::NOT_LOGGED_IN && 158 login_status_ != LoginStatus::NOT_LOGGED_IN &&
158 login_status_ != LoginStatus::LOCKED); 159 login_status_ != LoginStatus::LOCKED);
159 } 160 }
160 161
161 } // namespace ash 162 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698