Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 Loading... | |
| 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 |
| OLD | NEW |