summaryrefslogtreecommitdiffstats
path: root/ash/wm
diff options
context:
space:
mode:
authorstevenjb@google.com <stevenjb@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-30 23:12:02 +0000
committerstevenjb@google.com <stevenjb@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-30 23:12:02 +0000
commit6d6546e0497dae4572bcbf1edbc3950b87046256 (patch)
tree0203858fa083a153efb520c1c43d1ee365ec5db8 /ash/wm
parent43c15cbdfa1af7e5de8ebfcd423b0f84b96795b8 (diff)
downloadchromium_src-6d6546e0497dae4572bcbf1edbc3950b87046256.zip
chromium_src-6d6546e0497dae4572bcbf1edbc3950b87046256.tar.gz
chromium_src-6d6546e0497dae4572bcbf1edbc3950b87046256.tar.bz2
Prepare to support Ash notification tray:
* Separate status area widget from system tray * Support adding multiple trays to status area widget * Move the background animation into a common base class BUG=124914 TEST=Status area should look and behave the same as before. TBR=ben for ash/ OWNER Review URL: https://chromiumcodereview.appspot.com/10447040 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@139671 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/wm')
-rw-r--r--ash/wm/shelf_layout_manager.cc15
-rw-r--r--ash/wm/shelf_layout_manager_unittest.cc4
2 files changed, 12 insertions, 7 deletions
diff --git a/ash/wm/shelf_layout_manager.cc b/ash/wm/shelf_layout_manager.cc
index f0b65ae..e986853 100644
--- a/ash/wm/shelf_layout_manager.cc
+++ b/ash/wm/shelf_layout_manager.cc
@@ -11,6 +11,7 @@
#include "ash/shell.h"
#include "ash/shell_delegate.h"
#include "ash/shell_window_ids.h"
+#include "ash/system/status_area_widget.h"
#include "ash/system/tray/system_tray.h"
#include "ash/wm/workspace/workspace_manager.h"
#include "base/auto_reset.h"
@@ -195,8 +196,10 @@ bool ShelfLayoutManager::SetAlignment(ShelfAlignment alignment) {
alignment_ = alignment;
if (launcher_)
launcher_->SetAlignment(alignment);
- if (Shell::GetInstance()->tray())
- Shell::GetInstance()->tray()->SetShelfAlignment(alignment);
+ if (Shell::GetInstance()->status_area_widget())
+ Shell::GetInstance()->status_area_widget()->SetShelfAlignment(alignment);
+ if (Shell::GetInstance()->system_tray())
+ Shell::GetInstance()->system_tray()->SetShelfAlignment(alignment);
LayoutShelf();
return true;
}
@@ -492,8 +495,10 @@ 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()->tray())
- Shell::GetInstance()->tray()->SetPaintsBackground(!launcher_paints, type);
+ if (Shell::GetInstance()->system_tray()) {
+ Shell::GetInstance()->system_tray()->SetPaintsBackground(
+ !launcher_paints, type);
+ }
}
bool ShelfLayoutManager::GetLauncherPaintsBackground() const {
@@ -514,7 +519,7 @@ ShelfLayoutManager::AutoHideState ShelfLayoutManager::CalculateAutoHideState(
if (shell->GetAppListTargetVisibility())
return AUTO_HIDE_SHOWN;
- if (shell->tray() && shell->tray()->should_show_launcher())
+ if (shell->system_tray() && shell->system_tray()->should_show_launcher())
return AUTO_HIDE_SHOWN;
if (launcher_ && launcher_->IsShowingMenu())
diff --git a/ash/wm/shelf_layout_manager_unittest.cc b/ash/wm/shelf_layout_manager_unittest.cc
index 011951d..65606da 100644
--- a/ash/wm/shelf_layout_manager_unittest.cc
+++ b/ash/wm/shelf_layout_manager_unittest.cc
@@ -509,7 +509,7 @@ TEST_F(ShelfLayoutManagerTest, SetAlignment) {
launcher_bounds.width(),
shelf->launcher_widget()->GetContentsView()->GetPreferredSize().width());
EXPECT_EQ(SHELF_ALIGNMENT_LEFT,
- Shell::GetInstance()->tray()->shelf_alignment());
+ Shell::GetInstance()->system_tray()->shelf_alignment());
gfx::Rect status_bounds(shelf->status()->GetWindowScreenBounds());
EXPECT_GE(status_bounds.width(),
shelf->status()->GetContentsView()->GetPreferredSize().width());
@@ -532,7 +532,7 @@ TEST_F(ShelfLayoutManagerTest, SetAlignment) {
launcher_bounds.width(),
shelf->launcher_widget()->GetContentsView()->GetPreferredSize().width());
EXPECT_EQ(SHELF_ALIGNMENT_RIGHT,
- Shell::GetInstance()->tray()->shelf_alignment());
+ Shell::GetInstance()->system_tray()->shelf_alignment());
status_bounds = gfx::Rect(shelf->status()->GetWindowScreenBounds());
EXPECT_GE(status_bounds.width(),
shelf->status()->GetContentsView()->GetPreferredSize().width());