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

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

Issue 11415014: Stop using shell::GetInstance()->system_tray() in system tray items (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix single-letter typo :(. Created 8 years, 1 month 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/tray_item_view.h ('k') | ash/system/tray/tray_notification_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/tray/tray_item_view.cc
diff --git a/ash/system/tray/tray_item_view.cc b/ash/system/tray/tray_item_view.cc
index 23f0d53d62b00f22bbdf4a0dd311b726107e7cac..87644d08283cf8eb507ede15d6209c55a5aeecc0 100644
--- a/ash/system/tray/tray_item_view.cc
+++ b/ash/system/tray/tray_item_view.cc
@@ -4,8 +4,8 @@
#include "ash/system/tray/tray_item_view.h"
-#include "ash/shell.h"
#include "ash/system/tray/system_tray.h"
+#include "ash/system/tray/system_tray_item.h"
#include "ash/wm/shelf_types.h"
#include "ui/base/animation/slide_animation.h"
#include "ui/compositor/layer.h"
@@ -23,8 +23,9 @@ const int kTrayItemAnimationDurationMS = 200;
namespace ash {
namespace internal {
-TrayItemView::TrayItemView()
- : label_(NULL),
+TrayItemView::TrayItemView(SystemTrayItem* owner)
+ : owner_(owner),
+ label_(NULL),
image_view_(NULL) {
SetPaintToLayer(true);
SetFillsBoundsOpaquely(false);
@@ -77,8 +78,7 @@ int TrayItemView::GetAnimationDurationMS() {
gfx::Size TrayItemView::GetPreferredSize() {
gfx::Size size = DesiredSize();
- if (ash::Shell::GetInstance()->system_tray()->shelf_alignment() ==
- SHELF_ALIGNMENT_BOTTOM)
+ if (owner()->system_tray()->shelf_alignment() == SHELF_ALIGNMENT_BOTTOM)
size.set_height(kTrayIconHeight);
else
size.set_width(kTrayIconWidth);
« no previous file with comments | « ash/system/tray/tray_item_view.h ('k') | ash/system/tray/tray_notification_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698