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

Side by Side Diff: ui/arc/notification/arc_notification_manager.cc

Issue 1978313002: Support cancelling toast (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use std::deque instead of vector Created 4 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 unified diff | Download patch
« no previous file with comments | « components/arc/common/notifications.mojom ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/arc/notification/arc_notification_manager.h" 5 #include "ui/arc/notification/arc_notification_manager.h"
6 6
7 #include "ash/shell.h" 7 #include "ash/shell.h"
8 #include "ash/system/toast/toast_manager.h" 8 #include "ash/system/toast/toast_manager.h"
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 default: 172 default:
173 VLOG(3) << "Invalid button index (key: " << key << ", index: " << 173 VLOG(3) << "Invalid button index (key: " << key << ", index: " <<
174 button_index << ")."; 174 button_index << ").";
175 return; 175 return;
176 } 176 }
177 177
178 notifications_instance->SendNotificationEventToAndroid(key, command); 178 notifications_instance->SendNotificationEventToAndroid(key, command);
179 } 179 }
180 180
181 void ArcNotificationManager::OnToastPosted(mojom::ArcToastDataPtr data) { 181 void ArcNotificationManager::OnToastPosted(mojom::ArcToastDataPtr data) {
182 ash::Shell::GetInstance()->toast_manager()->Show(data->text, data->duration); 182 ash::Shell::GetInstance()->toast_manager()->Show(
183 ash::ToastData(data->id, data->text, data->duration));
183 } 184 }
184 185
185 void ArcNotificationManager::OnToastCancelled(mojom::ArcToastDataPtr data) { 186 void ArcNotificationManager::OnToastCancelled(mojom::ArcToastDataPtr data) {
186 // TODO(yoshiki): Implement cancel. 187 ash::Shell::GetInstance()->toast_manager()->Cancel(data->id);
187 } 188 }
188 189
189 } // namespace arc 190 } // namespace arc
OLDNEW
« no previous file with comments | « components/arc/common/notifications.mojom ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698