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

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
Index: ash/system/tray/system_tray.cc
diff --git a/ash/system/tray/system_tray.cc b/ash/system/tray/system_tray.cc
index 223c78ab1f59fe3b36c47c0b4df4a3e281de37c4..a027d1a7d66b74a851f84c99895af580a2f7abf8 100644
--- a/ash/system/tray/system_tray.cc
+++ b/ash/system/tray/system_tray.cc
@@ -39,6 +39,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"
@@ -210,7 +211,7 @@ class SystemTray::ActivationObserver
// SystemTray
SystemTray::SystemTray(WmShelf* wm_shelf)
- : TrayBackgroundView(wm_shelf, true),
+ : TrayBackgroundView(wm_shelf),
web_notification_tray_(nullptr),
detailed_item_(nullptr),
default_bubble_height_(0),
@@ -314,7 +315,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);
@@ -385,18 +386,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
James Cook 2017/04/17 16:54:35 Do things still work OK if you log in with a shelf
mohsen 2017/04/19 22:59:07 As far as I can tell, UpdateAfterShelfAlignmentCha
- // 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 {
@@ -563,11 +559,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.

Powered by Google App Engine
This is Rietveld 408576698