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

Unified Diff: ui/message_center/views/toast_contents_view.cc

Issue 2800923005: Pause close timer of notification while it's active (Closed)
Patch Set: Created 3 years, 8 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 | « ui/message_center/views/toast_contents_view.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/message_center/views/toast_contents_view.cc
diff --git a/ui/message_center/views/toast_contents_view.cc b/ui/message_center/views/toast_contents_view.cc
index 44dfcf410fee001e14df3c944e6540386a7398d4..64e9d91ddeb8901c629ad58ab77b3c5fc6b9f828 100644
--- a/ui/message_center/views/toast_contents_view.cc
+++ b/ui/message_center/views/toast_contents_view.cc
@@ -278,6 +278,14 @@ void ToastContentsView::OnWorkAreaChanged() {
Screen::GetScreen()->GetDisplayNearestWindow(native_view));
}
+void ToastContentsView::OnWidgetActivationChanged(views::Widget* widget,
+ bool active) {
+ if (active)
+ collection_->PausePopupTimers();
+ else
+ collection_->RestartPopupTimers();
+}
+
// views::View
void ToastContentsView::OnMouseEntered(const ui::MouseEvent& event) {
if (collection_)
@@ -389,6 +397,7 @@ void ToastContentsView::CreateWidget(
views::Widget* widget = new views::Widget();
alignment_delegate->ConfigureWidgetInitParamsForContainer(widget, &params);
widget->set_focus_on_creation(false);
+ widget->AddObserver(this);
#if defined(OS_WIN)
// We want to ensure that this toast always goes to the native desktop,
« no previous file with comments | « ui/message_center/views/toast_contents_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698