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

Side by Side Diff: chrome/browser/notifications/notification_platform_bridge_linux.cc

Issue 2866363002: Linux native notifications: Support infinite timeouts (Closed)
Patch Set: Created 3 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 | « 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 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
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
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 }
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