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

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

Issue 10443004: Move common notification layout to base class (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 years, 7 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/tray_constants.cc ('k') | ash/system/tray/tray_views.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/tray/tray_views.h
diff --git a/ash/system/tray/tray_views.h b/ash/system/tray/tray_views.h
index 0afebcf42690b4a781de9d02dc673416dc3e3d2c..ba5534fac2fc5ee7156b2a8417b897883f978dee 100644
--- a/ash/system/tray/tray_views.h
+++ b/ash/system/tray/tray_views.h
@@ -243,17 +243,30 @@ class SpecialPopupRow : public views::View {
};
// A view for closable notification views, laid out like:
-// [ contents (x) ]
-// The close button will call OnClose() when pressed.
+// -------------------
+// | icon contents x |
+// ----------------v--
+// The close button will call OnClose() when clicked.
class TrayNotificationView : public views::View,
public views::ButtonListener {
public:
- TrayNotificationView();
+ // If icon_id is 0, no icon image will be set. SetIconImage can be called
+ // to later set the icon image.
+ explicit TrayNotificationView(int icon_id);
virtual ~TrayNotificationView();
// InitView must be called once with the contents to be displayed.
void InitView(views::View* contents);
+ // Sets/updates the icon image.
+ void SetIconImage(const SkBitmap& image);
+
+ // Replaces the contents view.
+ void UpdateView(views::View* new_contents);
+
+ // Replaces the contents view and updates the icon image.
+ void UpdateViewAndImage(views::View* new_contents, const SkBitmap& image);
+
// Overridden from ButtonListener.
virtual void ButtonPressed(views::Button* sender,
const views::Event& event) OVERRIDE;
@@ -263,6 +276,9 @@ class TrayNotificationView : public views::View,
virtual void OnClose() = 0;
private:
+ int icon_id_;
+ views::ImageView* icon_;
+
DISALLOW_COPY_AND_ASSIGN(TrayNotificationView);
};
« no previous file with comments | « ash/system/tray/tray_constants.cc ('k') | ash/system/tray/tray_views.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698