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

Unified Diff: ash/system/tray/system_tray.cc

Issue 2103603002: mash: Remove StatusAreaWidget references from system tray classes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments, rename SetSystemTrayHeight to SetTrayBubbleHeight Created 4 years, 6 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_unittest.cc » ('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 7f41e99f762cccff9601dcd80f42991ee0d6979f..daddcb370d4ccfeeb134e0b6334d96eac3ee96b2 100644
--- a/ash/system/tray/system_tray.cc
+++ b/ash/system/tray/system_tray.cc
@@ -18,15 +18,14 @@
#include "ash/common/system/tray_accessibility.h"
#include "ash/common/system/update/tray_update.h"
#include "ash/common/system/user/tray_user_separator.h"
+#include "ash/common/system/web_notification/web_notification_tray.h"
#include "ash/common/wm_lookup.h"
#include "ash/common/wm_root_window_controller.h"
#include "ash/common/wm_shell.h"
#include "ash/common/wm_window.h"
#include "ash/shell.h"
#include "ash/system/cast/tray_cast.h"
-#include "ash/system/status_area_widget.h"
#include "ash/system/user/tray_user.h"
-#include "ash/system/web_notification/web_notification_tray.h"
#include "base/logging.h"
#include "base/metrics/histogram.h"
#include "base/strings/utf_string_conversions.h"
@@ -127,10 +126,9 @@ class SystemBubbleWrapper {
// SystemTray
-SystemTray::SystemTray(StatusAreaWidget* status_area_widget)
- : TrayBackgroundView(status_area_widget->wm_shelf()),
- status_area_widget_(status_area_widget),
- items_(),
+SystemTray::SystemTray(WmShelf* wm_shelf)
+ : TrayBackgroundView(wm_shelf),
+ web_notification_tray_(nullptr),
detailed_item_(nullptr),
default_bubble_height_(0),
hide_notifications_(false),
@@ -141,7 +139,6 @@ SystemTray::SystemTray(StatusAreaWidget* status_area_widget)
tray_update_(nullptr),
screen_capture_tray_item_(nullptr),
screen_share_tray_item_(nullptr) {
- DCHECK(status_area_widget_);
SetContentsBackground();
}
@@ -155,11 +152,20 @@ SystemTray::~SystemTray() {
}
}
-void SystemTray::InitializeTrayItems(SystemTrayDelegate* delegate) {
+void SystemTray::InitializeTrayItems(
+ SystemTrayDelegate* delegate,
+ WebNotificationTray* web_notification_tray) {
+ DCHECK(web_notification_tray);
+ web_notification_tray_ = web_notification_tray;
TrayBackgroundView::Initialize();
CreateItems(delegate);
}
+void SystemTray::Shutdown() {
+ DCHECK(web_notification_tray_);
+ web_notification_tray_ = nullptr;
+}
+
void SystemTray::CreateItems(SystemTrayDelegate* delegate) {
WmShell* wm_shell = WmShell::Get();
#if !defined(OS_WIN)
@@ -588,7 +594,8 @@ void SystemTray::UpdateWebNotifications() {
height =
std::max(0, work_area.height() - bubble_view->GetBoundsInScreen().y());
}
- status_area_widget_->web_notification_tray()->SetSystemTrayHeight(height);
+ if (web_notification_tray_)
+ web_notification_tray_->SetTrayBubbleHeight(height);
}
base::string16 SystemTray::GetAccessibleTimeString(
« no previous file with comments | « ash/system/tray/system_tray.h ('k') | ash/system/tray/system_tray_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698