Chromium Code Reviews| 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 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 527 spec_version_ == base::Version(std::vector<uint32_t>{1, 1}) | 527 spec_version_ == base::Version(std::vector<uint32_t>{1, 1}) |
| 528 ? "image_path" | 528 ? "image_path" |
| 529 : "image-path"); | 529 : "image-path"); |
| 530 image_path_writer.AppendVariantOfString(icon_file->file_path().value()); | 530 image_path_writer.AppendVariantOfString(icon_file->file_path().value()); |
| 531 hints_writer.CloseContainer(&image_path_writer); | 531 hints_writer.CloseContainer(&image_path_writer); |
| 532 data->resource_files.push_back(std::move(icon_file)); | 532 data->resource_files.push_back(std::move(icon_file)); |
| 533 } | 533 } |
| 534 | 534 |
| 535 writer.CloseContainer(&hints_writer); | 535 writer.CloseContainer(&hints_writer); |
| 536 | 536 |
| 537 const int32_t kExpireTimeoutDefault = -1; | 537 const int32_t kExpireTimeoutDefault = -1; |
|
Peter Beverloo
2017/05/09 22:52:08
qq: is there any way to know what the default time
Tom (Use chromium acct)
2017/05/10 21:20:58
There's no way to know :( We could set the timeou
| |
| 538 writer.AppendInt32(kExpireTimeoutDefault); | 538 const int32_t kExpireTimeoutNever = 0; |
| 539 writer.AppendInt32(notification->never_timeout() ? kExpireTimeoutNever | |
| 540 : kExpireTimeoutDefault); | |
| 539 | 541 |
| 540 std::unique_ptr<dbus::Response> response = | 542 std::unique_ptr<dbus::Response> response = |
| 541 notification_proxy_->CallMethodAndBlock( | 543 notification_proxy_->CallMethodAndBlock( |
| 542 &method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT); | 544 &method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT); |
| 543 if (response) { | 545 if (response) { |
| 544 dbus::MessageReader reader(response.get()); | 546 dbus::MessageReader reader(response.get()); |
| 545 reader.PopUint32(&data->dbus_id); | 547 reader.PopUint32(&data->dbus_id); |
| 546 } | 548 } |
| 547 if (!data->dbus_id) { | 549 if (!data->dbus_id) { |
| 548 // There was some sort of error with creating the notification. | 550 // There was some sort of error with creating the notification. |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 804 } | 806 } |
| 805 | 807 |
| 806 void NotificationPlatformBridgeLinux::SetReadyCallback( | 808 void NotificationPlatformBridgeLinux::SetReadyCallback( |
| 807 NotificationBridgeReadyCallback callback) { | 809 NotificationBridgeReadyCallback callback) { |
| 808 impl_->SetReadyCallback(std::move(callback)); | 810 impl_->SetReadyCallback(std::move(callback)); |
| 809 } | 811 } |
| 810 | 812 |
| 811 void NotificationPlatformBridgeLinux::CleanUp() { | 813 void NotificationPlatformBridgeLinux::CleanUp() { |
| 812 impl_->CleanUp(); | 814 impl_->CleanUp(); |
| 813 } | 815 } |
| OLD | NEW |