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

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

Issue 2394483004: arc: OnClosedFromAndroid removes notifications as not by_user (Closed)
Patch Set: Created 4 years, 2 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 | « no previous file | 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 <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "ash/common/system/toast/toast_manager.h" 10 #include "ash/common/system/toast/toast_manager.h"
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 void ArcNotificationManager::OnNotificationRemoved(const mojo::String& key) { 94 void ArcNotificationManager::OnNotificationRemoved(const mojo::String& key) {
95 auto it = items_.find(key.get()); 95 auto it = items_.find(key.get());
96 if (it == items_.end()) { 96 if (it == items_.end()) {
97 VLOG(3) << "Android requests to remove a notification (key: " << key 97 VLOG(3) << "Android requests to remove a notification (key: " << key
98 << "), but it is already gone."; 98 << "), but it is already gone.";
99 return; 99 return;
100 } 100 }
101 101
102 std::unique_ptr<ArcNotificationItem> item = std::move(it->second); 102 std::unique_ptr<ArcNotificationItem> item = std::move(it->second);
103 items_.erase(it); 103 items_.erase(it);
104 item->OnClosedFromAndroid(true /* by_user */); 104 item->OnClosedFromAndroid(false /* by_user */);
yoshiki 2016/10/06 06:37:13 Could you remove the "by_user" argument from ArcNo
xiyuan 2016/10/06 16:15:41 Sounds good. Done.
105 } 105 }
106 106
107 void ArcNotificationManager::SendNotificationRemovedFromChrome( 107 void ArcNotificationManager::SendNotificationRemovedFromChrome(
108 const std::string& key) { 108 const std::string& key) {
109 auto it = items_.find(key); 109 auto it = items_.find(key);
110 if (it == items_.end()) { 110 if (it == items_.end()) {
111 VLOG(3) << "Chrome requests to remove a notification (key: " << key 111 VLOG(3) << "Chrome requests to remove a notification (key: " << key
112 << "), but it is already gone."; 112 << "), but it is already gone.";
113 return; 113 return;
114 } 114 }
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 ash::WmShell::Get()->toast_manager()->Show( 238 ash::WmShell::Get()->toast_manager()->Show(
239 ash::ToastData(data->id, data->text.To<base::string16>(), data->duration, 239 ash::ToastData(data->id, data->text.To<base::string16>(), data->duration,
240 data->dismiss_text.To<base::string16>())); 240 data->dismiss_text.To<base::string16>()));
241 } 241 }
242 242
243 void ArcNotificationManager::OnToastCancelled(mojom::ArcToastDataPtr data) { 243 void ArcNotificationManager::OnToastCancelled(mojom::ArcToastDataPtr data) {
244 ash::WmShell::Get()->toast_manager()->Cancel(data->id); 244 ash::WmShell::Get()->toast_manager()->Cancel(data->id);
245 } 245 }
246 246
247 } // namespace arc 247 } // namespace arc
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698