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

Unified Diff: ash/system/tray/tray_background_view.h

Issue 10824153: Change Ash web notification behavior (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix clang Created 8 years, 5 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_bubble.cc ('k') | ash/system/tray/tray_background_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/tray/tray_background_view.h
diff --git a/ash/system/tray/tray_background_view.h b/ash/system/tray/tray_background_view.h
index 363cea4ddcc12f4994de6ac17b5e67678d864619..d6ee3ba281352306203f8bda8cf4e21d9e72891c 100644
--- a/ash/system/tray/tray_background_view.h
+++ b/ash/system/tray/tray_background_view.h
@@ -13,6 +13,7 @@
namespace ash {
namespace internal {
+class StatusAreaWidget;
class TrayBackground;
// Base class for children of StatusAreaWidget: SystemTray, WebNotificationTray.
@@ -23,7 +24,38 @@ class TrayBackground;
class ASH_EXPORT TrayBackgroundView : public internal::ActionableView,
public BackgroundAnimatorDelegate {
public:
- TrayBackgroundView();
+ // Base class for tray containers. Sets the border and layout. The container
+ // auto-resizes the widget when necessary.
+ class TrayContainer : public views::View {
+ public:
+ explicit TrayContainer(ShelfAlignment alignment);
+ virtual ~TrayContainer() {}
+
+ void SetAlignment(ShelfAlignment alignment);
+
+ void set_size(const gfx::Size& size) { size_ = size; }
+
+ // Overridden from views::View.
+ virtual gfx::Size GetPreferredSize() OVERRIDE;
+
+ protected:
+ // Overridden from views::View.
+ virtual void ChildPreferredSizeChanged(views::View* child) OVERRIDE;
+ virtual void ChildVisibilityChanged(View* child) OVERRIDE;
+ virtual void ViewHierarchyChanged(bool is_add,
+ View* parent,
+ View* child) OVERRIDE;
+
+ private:
+ void UpdateLayout();
+
+ ShelfAlignment alignment_;
+ gfx::Size size_;
+
+ DISALLOW_COPY_AND_ASSIGN(TrayContainer);
+ };
+
+ explicit TrayBackgroundView(internal::StatusAreaWidget* status_area_widget);
virtual ~TrayBackgroundView();
// Overridden from views::View.
@@ -49,9 +81,21 @@ class ASH_EXPORT TrayBackgroundView : public internal::ActionableView,
bool value,
internal::BackgroundAnimator::ChangeType change_type);
+ StatusAreaWidget* status_area_widget() {
+ return status_area_widget_;
+ }
+ TrayContainer* tray_container() const { return tray_container_; }
ShelfAlignment shelf_alignment() const { return shelf_alignment_; }
private:
+ void SetBorder();
+
+ // Unowned pointer to parent widget.
+ StatusAreaWidget* status_area_widget_;
+
+ // Convenience pointer to the contents view.
+ TrayContainer* tray_container_;
+
// Shelf alignment.
ShelfAlignment shelf_alignment_;
« no previous file with comments | « ash/system/tray/system_tray_bubble.cc ('k') | ash/system/tray/tray_background_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698