diff options
author | stevenjb@chromium.org <stevenjb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-02 02:39:23 +0000 |
---|---|---|
committer | stevenjb@chromium.org <stevenjb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-02 02:39:23 +0000 |
commit | 83cf3c2723a0093c478a9c79fbbb2896ba761a84 (patch) | |
tree | 886bc29948c423ea33122e6202c83c9f43c17af1 /ash/system | |
parent | ae82efcf08991eee3c8be508e2182655ba0abbca (diff) | |
download | chromium_src-83cf3c2723a0093c478a9c79fbbb2896ba761a84.zip chromium_src-83cf3c2723a0093c478a9c79fbbb2896ba761a84.tar.gz chromium_src-83cf3c2723a0093c478a9c79fbbb2896ba761a84.tar.bz2 |
Fix image update for web notifications
BUG=153439
Review URL: https://chromiumcodereview.appspot.com/11026013
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@159624 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/system')
-rw-r--r-- | ash/system/web_notification/popup_bubble.cc | 6 | ||||
-rw-r--r-- | ash/system/web_notification/popup_bubble.h | 4 | ||||
-rw-r--r-- | ash/system/web_notification/web_notification_tray.cc | 1 |
3 files changed, 9 insertions, 2 deletions
diff --git a/ash/system/web_notification/popup_bubble.cc b/ash/system/web_notification/popup_bubble.cc index 93e1901..e3d186c 100644 --- a/ash/system/web_notification/popup_bubble.cc +++ b/ash/system/web_notification/popup_bubble.cc @@ -69,7 +69,8 @@ class PopupBubbleContentsView : public WebNotificationContentsView { PopupBubble::PopupBubble(WebNotificationTray* tray) : WebNotificationBubble(tray), contents_view_(NULL), - num_popups_(0) { + num_popups_(0), + dirty_(false) { TrayBubbleView::InitParams init_params = GetInitParams(); init_params.arrow_color = kBackgroundColor; init_params.close_on_deactivate = false; @@ -110,7 +111,8 @@ void PopupBubble::UpdateBubbleView() { } // Only update the popup tray if the number of visible popup notifications // has changed. - if (popup_notifications.size() != num_popups_) { + if (popup_notifications.size() != num_popups_ || dirty()) { + set_dirty(false); num_popups_ = popup_notifications.size(); contents_view_->Update(popup_notifications); bubble_view_->Show(); diff --git a/ash/system/web_notification/popup_bubble.h b/ash/system/web_notification/popup_bubble.h index 3d4bd7a..bc0d8c6 100644 --- a/ash/system/web_notification/popup_bubble.h +++ b/ash/system/web_notification/popup_bubble.h @@ -25,6 +25,9 @@ class PopupBubble : public WebNotificationBubble { size_t NumMessageViewsForTest() const; + bool dirty() const { return dirty_; } + void set_dirty(bool dirty) { dirty_ = dirty; } + // Overridden from TrayBubbleView::Host. virtual void BubbleViewDestroyed() OVERRIDE; @@ -45,6 +48,7 @@ class PopupBubble : public WebNotificationBubble { base::OneShotTimer<PopupBubble> autoclose_; PopupBubbleContentsView* contents_view_; size_t num_popups_; + bool dirty_; DISALLOW_COPY_AND_ASSIGN(PopupBubble); }; diff --git a/ash/system/web_notification/web_notification_tray.cc b/ash/system/web_notification/web_notification_tray.cc index 27432bb..bd820f2 100644 --- a/ash/system/web_notification/web_notification_tray.cc +++ b/ash/system/web_notification/web_notification_tray.cc @@ -121,6 +121,7 @@ void WebNotificationTray::SetNotificationImage(const std::string& id, if (!notification_list_->SetNotificationImage(id, image)) return; UpdateTrayAndBubble(); + popup_bubble()->set_dirty(true); ShowPopupBubble(); } |