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

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

Issue 2866363002: Linux native notifications: Support infinite timeouts (Closed)
Patch Set: Rebase 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 | chrome/browser/notifications/notification_platform_bridge_linux_unittest.cc » ('j') | 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 547 matching lines...) Expand 10 before | Expand all | Expand 10 after
558 ? "image_path" 558 ? "image_path"
559 : "image-path"); 559 : "image-path");
560 image_path_writer.AppendVariantOfString(icon_file->file_path().value()); 560 image_path_writer.AppendVariantOfString(icon_file->file_path().value());
561 hints_writer.CloseContainer(&image_path_writer); 561 hints_writer.CloseContainer(&image_path_writer);
562 data->resource_files.push_back(std::move(icon_file)); 562 data->resource_files.push_back(std::move(icon_file));
563 } 563 }
564 564
565 writer.CloseContainer(&hints_writer); 565 writer.CloseContainer(&hints_writer);
566 566
567 const int32_t kExpireTimeoutDefault = -1; 567 const int32_t kExpireTimeoutDefault = -1;
568 writer.AppendInt32(kExpireTimeoutDefault); 568 const int32_t kExpireTimeoutNever = 0;
569 writer.AppendInt32(notification->never_timeout() ? kExpireTimeoutNever
570 : kExpireTimeoutDefault);
569 571
570 std::unique_ptr<dbus::Response> response = 572 std::unique_ptr<dbus::Response> response =
571 notification_proxy_->CallMethodAndBlock( 573 notification_proxy_->CallMethodAndBlock(
572 &method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT); 574 &method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT);
573 if (response) { 575 if (response) {
574 dbus::MessageReader reader(response.get()); 576 dbus::MessageReader reader(response.get());
575 reader.PopUint32(&data->dbus_id); 577 reader.PopUint32(&data->dbus_id);
576 } 578 }
577 if (!data->dbus_id) { 579 if (!data->dbus_id) {
578 // There was some sort of error with creating the notification. 580 // There was some sort of error with creating the notification.
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
840 } 842 }
841 843
842 void NotificationPlatformBridgeLinux::SetReadyCallback( 844 void NotificationPlatformBridgeLinux::SetReadyCallback(
843 NotificationBridgeReadyCallback callback) { 845 NotificationBridgeReadyCallback callback) {
844 impl_->SetReadyCallback(std::move(callback)); 846 impl_->SetReadyCallback(std::move(callback));
845 } 847 }
846 848
847 void NotificationPlatformBridgeLinux::CleanUp() { 849 void NotificationPlatformBridgeLinux::CleanUp() {
848 impl_->CleanUp(); 850 impl_->CleanUp();
849 } 851 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/notifications/notification_platform_bridge_linux_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698