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

Unified Diff: ash/system/status_area_widget.cc

Issue 196473011: Attempting to reland the Overview Button Change. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 9 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.cc
diff --git a/ash/system/status_area_widget.cc b/ash/system/status_area_widget.cc
index d302efcb6c7c7c0fbfc875c7c6a52e620bc56a8f..798ea8e8b8bc50c3479d4e19ef83cc20f6923143 100644
--- a/ash/system/status_area_widget.cc
+++ b/ash/system/status_area_widget.cc
@@ -11,6 +11,7 @@
#include "ash/shell_delegate.h"
#include "ash/shell_window_ids.h"
#include "ash/system/bluetooth/bluetooth_observer.h"
+#include "ash/system/overview/overview_button_tray.h"
#include "ash/system/session/logout_button_tray.h"
#include "ash/system/status_area_widget_delegate.h"
#include "ash/system/tray/system_tray.h"
@@ -33,6 +34,7 @@ const char StatusAreaWidget::kNativeViewName[] = "StatusAreaWidget";
StatusAreaWidget::StatusAreaWidget(aura::Window* status_container)
: status_area_widget_delegate_(new internal::StatusAreaWidgetDelegate),
+ overview_button_tray_(NULL),
system_tray_(NULL),
web_notification_tray_(NULL),
logout_button_tray_(NULL),
@@ -55,26 +57,25 @@ StatusAreaWidget::~StatusAreaWidget() {
}
void StatusAreaWidget::CreateTrayViews() {
+ AddOverviewButtonTray();
AddSystemTray();
AddWebNotificationTray();
AddLogoutButtonTray();
#if defined(OS_CHROMEOS)
AddVirtualKeyboardTray();
#endif
+
SystemTrayDelegate* delegate =
ash::Shell::GetInstance()->system_tray_delegate();
DCHECK(delegate);
// Initialize after all trays have been created.
- if (system_tray_)
- system_tray_->InitializeTrayItems(delegate);
- if (web_notification_tray_)
- web_notification_tray_->Initialize();
- if (logout_button_tray_)
- logout_button_tray_->Initialize();
+ system_tray_->InitializeTrayItems(delegate);
+ web_notification_tray_->Initialize();
+ logout_button_tray_->Initialize();
#if defined(OS_CHROMEOS)
- if (virtual_keyboard_tray_)
- virtual_keyboard_tray_->Initialize();
+ virtual_keyboard_tray_->Initialize();
#endif
+ overview_button_tray_->Initialize();
UpdateAfterLoginStatusChange(delegate->GetUserLoginStatus());
}
@@ -92,6 +93,8 @@ void StatusAreaWidget::Shutdown() {
delete virtual_keyboard_tray_;
virtual_keyboard_tray_ = NULL;
#endif
+ delete overview_button_tray_;
+ overview_button_tray_ = NULL;
}
bool StatusAreaWidget::ShouldShowShelf() const {
@@ -106,8 +109,8 @@ bool StatusAreaWidget::ShouldShowShelf() const {
// If the shelf is currently visible, don't hide the shelf if the mouse
// is in any of the notification bubbles.
return (system_tray_ && system_tray_->IsMouseInNotificationBubble()) ||
- (web_notification_tray_ &&
- web_notification_tray_->IsMouseInNotificationBubble());
+ (web_notification_tray_ &&
+ web_notification_tray_->IsMouseInNotificationBubble());
}
bool StatusAreaWidget::IsMessageBubbleShown() const {
@@ -144,6 +147,11 @@ void StatusAreaWidget::AddVirtualKeyboardTray() {
}
#endif
+void StatusAreaWidget::AddOverviewButtonTray() {
+ overview_button_tray_ = new OverviewButtonTray(this);
+ status_area_widget_delegate_->AddTray(overview_button_tray_);
+}
+
void StatusAreaWidget::SetShelfAlignment(ShelfAlignment alignment) {
status_area_widget_delegate_->set_alignment(alignment);
if (system_tray_)
@@ -156,6 +164,8 @@ void StatusAreaWidget::SetShelfAlignment(ShelfAlignment alignment) {
if (virtual_keyboard_tray_)
virtual_keyboard_tray_->SetShelfAlignment(alignment);
#endif
+ if (overview_button_tray_)
+ overview_button_tray_->SetShelfAlignment(alignment);
status_area_widget_delegate_->UpdateLayout();
}

Powered by Google App Engine
This is Rietveld 408576698