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

Unified Diff: ash/wm/shelf_layout_manager.cc

Issue 10514008: Add WebNotificationTray (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 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/web_notification/web_notification_tray_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/shelf_layout_manager.cc
diff --git a/ash/wm/shelf_layout_manager.cc b/ash/wm/shelf_layout_manager.cc
index 3f2e857e7dfbb446e4d7bacbdb2712832b0d91a2..8e83ba9cfeebe9f8c0279ab3ee1d53f03f9f5f29 100644
--- a/ash/wm/shelf_layout_manager.cc
+++ b/ash/wm/shelf_layout_manager.cc
@@ -13,6 +13,7 @@
#include "ash/shell_window_ids.h"
#include "ash/system/status_area_widget.h"
#include "ash/system/tray/system_tray.h"
+#include "ash/system/web_notification/web_notification_tray.h"
#include "ash/wm/workspace/workspace_manager.h"
#include "base/auto_reset.h"
#include "base/i18n/rtl.h"
@@ -196,10 +197,15 @@ bool ShelfLayoutManager::SetAlignment(ShelfAlignment alignment) {
alignment_ = alignment;
if (launcher_)
launcher_->SetAlignment(alignment);
- if (Shell::GetInstance()->status_area_widget())
+ StatusAreaWidget* status_area_widget =
+ Shell::GetInstance()->status_area_widget();
+ if (status_area_widget) {
Shell::GetInstance()->status_area_widget()->SetShelfAlignment(alignment);
- if (Shell::GetInstance()->system_tray())
- Shell::GetInstance()->system_tray()->SetShelfAlignment(alignment);
+ if (status_area_widget->system_tray())
+ status_area_widget->system_tray()->SetShelfAlignment(alignment);
+ if (status_area_widget->web_notification_tray())
+ status_area_widget->web_notification_tray()->SetShelfAlignment(alignment);
+ }
LayoutShelf();
return true;
}
@@ -493,8 +499,16 @@ void ShelfLayoutManager::UpdateShelfBackground(
launcher_->SetPaintsBackground(launcher_paints, type);
// SystemTray normally draws a background, but we don't want it to draw a
// background when the launcher does.
- if (Shell::GetInstance()->system_tray()) {
- Shell::GetInstance()->system_tray()->SetPaintsBackground(
+ StatusAreaWidget* status_area_widget =
+ Shell::GetInstance()->status_area_widget();
+ if (!status_area_widget)
+ return;
+ if (status_area_widget->system_tray()) {
+ status_area_widget->system_tray()->SetPaintsBackground(
+ !launcher_paints, type);
+ }
+ if (status_area_widget->web_notification_tray()) {
+ status_area_widget->web_notification_tray()->SetPaintsBackground(
!launcher_paints, type);
}
}
« no previous file with comments | « ash/system/web_notification/web_notification_tray_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698