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

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

Issue 2726773003: Reland: Make popup notification active on being clicked (Closed)
Patch Set: Relanded Patch Created 3 years, 10 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 e20b03e7f161de1d8f9499f8b5f1c14fde9a3d63..44dfcf410fee001e14df3c944e6540386a7398d4 100644
--- a/ui/message_center/views/toast_contents_view.cc
+++ b/ui/message_center/views/toast_contents_view.cc
@@ -44,6 +44,9 @@ const int kFadeInOutDuration = 200;
} // namespace.
// static
+const char ToastContentsView::kViewClassName[] = "ToastContentsView";
+
+// static
gfx::Size ToastContentsView::GetToastSizeForView(const views::View* view) {
int width = kNotificationWidth + view->GetInsets().width();
return gfx::Size(width, view->GetHeightForWidth(width));
@@ -168,6 +171,12 @@ void ToastContentsView::SetBoundsWithAnimation(gfx::Rect new_bounds) {
bounds_animation_->Show();
}
+void ToastContentsView::ActivateToast() {
+ set_can_activate(true);
+ if (GetWidget())
+ GetWidget()->Activate();
+}
+
void ToastContentsView::StartFadeIn() {
// The decrement is done in OnBoundsAnimationEndedOrCancelled callback.
if (collection_)
@@ -315,6 +324,10 @@ void ToastContentsView::GetAccessibleNodeData(ui::AXNodeData* node_data) {
node_data->role = ui::AX_ROLE_WINDOW;
}
+const char* ToastContentsView::GetClassName() const {
+ return kViewClassName;
+}
+
void ToastContentsView::ClickOnNotification(
const std::string& notification_id) {
if (collection_)
« 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