OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 "chrome/browser/notifications/notification_platform_bridge_linux.h" | 5 #include "chrome/browser/notifications/notification_platform_bridge_linux.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <memory> | 8 #include <memory> |
9 #include <set> | 9 #include <set> |
10 #include <unordered_map> | 10 #include <unordered_map> |
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
531 ? "image_path" | 531 ? "image_path" |
532 : "image-path"); | 532 : "image-path"); |
533 image_path_writer.AppendVariantOfString(icon_file->file_path().value()); | 533 image_path_writer.AppendVariantOfString(icon_file->file_path().value()); |
534 hints_writer.CloseContainer(&image_path_writer); | 534 hints_writer.CloseContainer(&image_path_writer); |
535 data->resource_files.push_back(std::move(icon_file)); | 535 data->resource_files.push_back(std::move(icon_file)); |
536 } | 536 } |
537 | 537 |
538 writer.CloseContainer(&hints_writer); | 538 writer.CloseContainer(&hints_writer); |
539 | 539 |
540 const int32_t kExpireTimeoutDefault = -1; | 540 const int32_t kExpireTimeoutDefault = -1; |
541 writer.AppendInt32(kExpireTimeoutDefault); | 541 const int32_t kExpireTimeoutNever = 0; |
| 542 writer.AppendInt32(notification->never_timeout() ? kExpireTimeoutNever |
| 543 : kExpireTimeoutDefault); |
542 | 544 |
543 std::unique_ptr<dbus::Response> response = | 545 std::unique_ptr<dbus::Response> response = |
544 notification_proxy_->CallMethodAndBlock( | 546 notification_proxy_->CallMethodAndBlock( |
545 &method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT); | 547 &method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT); |
546 if (response) { | 548 if (response) { |
547 dbus::MessageReader reader(response.get()); | 549 dbus::MessageReader reader(response.get()); |
548 reader.PopUint32(&data->dbus_id); | 550 reader.PopUint32(&data->dbus_id); |
549 } | 551 } |
550 if (!data->dbus_id) { | 552 if (!data->dbus_id) { |
551 // There was some sort of error with creating the notification. | 553 // There was some sort of error with creating the notification. |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
807 } | 809 } |
808 | 810 |
809 void NotificationPlatformBridgeLinux::SetReadyCallback( | 811 void NotificationPlatformBridgeLinux::SetReadyCallback( |
810 NotificationBridgeReadyCallback callback) { | 812 NotificationBridgeReadyCallback callback) { |
811 impl_->SetReadyCallback(std::move(callback)); | 813 impl_->SetReadyCallback(std::move(callback)); |
812 } | 814 } |
813 | 815 |
814 void NotificationPlatformBridgeLinux::CleanUp() { | 816 void NotificationPlatformBridgeLinux::CleanUp() { |
815 impl_->CleanUp(); | 817 impl_->CleanUp(); |
816 } | 818 } |
OLD | NEW |