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

Unified Diff: ash/system/tray/system_tray.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
« no previous file with comments | « ash/system/tray/system_tray.h ('k') | ash/system/tray/system_tray_item.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/tray/system_tray.cc
diff --git a/ash/system/tray/system_tray.cc b/ash/system/tray/system_tray.cc
index 5139ec058af55304bc45dff348f1560e27ab7b2b..f1909a0f4fcec8cfa65cdcd5c479625ed4794d13 100644
--- a/ash/system/tray/system_tray.cc
+++ b/ash/system/tray/system_tray.cc
@@ -40,6 +40,7 @@
#include "ash/system/tray/system_tray_item.h"
#include "ash/system/tray/tray_bubble_wrapper.h"
#include "ash/system/tray/tray_constants.h"
+#include "ash/system/tray/tray_container.h"
#include "ash/system/tray_accessibility.h"
#include "ash/system/tray_caps_lock.h"
#include "ash/system/tray_tracing.h"
@@ -207,7 +208,7 @@ class SystemTray::ActivationObserver
// SystemTray
-SystemTray::SystemTray(WmShelf* wm_shelf) : TrayBackgroundView(wm_shelf, true) {
+SystemTray::SystemTray(WmShelf* wm_shelf) : TrayBackgroundView(wm_shelf) {
SetInkDropMode(InkDropMode::ON);
// Since user avatar is on the right hand side of System tray of a
@@ -298,7 +299,7 @@ void SystemTray::AddTrayItem(std::unique_ptr<SystemTrayItem> item) {
SystemTrayDelegate* delegate = Shell::Get()->system_tray_delegate();
views::View* tray_item =
item_ptr->CreateTrayView(delegate->GetUserLoginStatus());
- item_ptr->UpdateAfterShelfAlignmentChange(shelf_alignment());
+ item_ptr->UpdateAfterShelfAlignmentChange();
if (tray_item) {
tray_container()->AddChildViewAt(tray_item, 0);
@@ -369,18 +370,13 @@ void SystemTray::UpdateAfterLoginStatusChange(LoginStatus login_status) {
for (const auto& item : items_)
item->UpdateAfterLoginStatusChange(login_status);
- // Items default to SHELF_ALIGNMENT_BOTTOM. Update them if the initial
- // position of the shelf differs.
- if (!IsHorizontalAlignment(shelf_alignment()))
- UpdateAfterShelfAlignmentChange(shelf_alignment());
-
SetVisible(true);
PreferredSizeChanged();
}
-void SystemTray::UpdateAfterShelfAlignmentChange(ShelfAlignment alignment) {
+void SystemTray::UpdateItemsAfterShelfAlignmentChange() {
for (const auto& item : items_)
- item->UpdateAfterShelfAlignmentChange(alignment);
+ item->UpdateAfterShelfAlignmentChange();
}
bool SystemTray::ShouldShowShelf() const {
@@ -547,11 +543,9 @@ base::string16 SystemTray::GetAccessibleTimeString(
base::kKeepAmPm);
}
-void SystemTray::SetShelfAlignment(ShelfAlignment alignment) {
- if (alignment == shelf_alignment())
- return;
- TrayBackgroundView::SetShelfAlignment(alignment);
- UpdateAfterShelfAlignmentChange(alignment);
+void SystemTray::UpdateAfterShelfAlignmentChange() {
+ TrayBackgroundView::UpdateAfterShelfAlignmentChange();
+ UpdateItemsAfterShelfAlignmentChange();
// Destroy any existing bubble so that it is rebuilt correctly.
CloseSystemBubbleAndDeactivateSystemTray();
// Rebuild any notification bubble.
« no previous file with comments | « ash/system/tray/system_tray.h ('k') | ash/system/tray/system_tray_item.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698