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 <sstream> | 10 #include <sstream> |
(...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
572 const std::string label = base::UTF16ToUTF8(button_info.title); | 572 const std::string label = base::UTF16ToUTF8(button_info.title); |
573 actions.push_back(id); | 573 actions.push_back(id); |
574 actions.push_back(label); | 574 actions.push_back(label); |
575 } | 575 } |
576 if (notification->clickable()) { | 576 if (notification->clickable()) { |
577 // Special case: the pair ("default", "") will not add a button, | 577 // Special case: the pair ("default", "") will not add a button, |
578 // but instead makes the entire notification clickable. | 578 // but instead makes the entire notification clickable. |
579 actions.push_back(kDefaultButtonId); | 579 actions.push_back(kDefaultButtonId); |
580 actions.push_back(""); | 580 actions.push_back(""); |
581 } | 581 } |
582 // Always add a settings button. | 582 // Always add a settings button for web notifications. |
583 actions.push_back(kSettingsButtonId); | 583 if (notification_type != NotificationCommon::EXTENSION) { |
584 actions.push_back( | 584 actions.push_back(kSettingsButtonId); |
585 l10n_util::GetStringUTF8(IDS_NOTIFICATION_BUTTON_SETTINGS)); | 585 actions.push_back( |
| 586 l10n_util::GetStringUTF8(IDS_NOTIFICATION_BUTTON_SETTINGS)); |
| 587 } |
586 } | 588 } |
587 writer.AppendArrayOfStrings(actions); | 589 writer.AppendArrayOfStrings(actions); |
588 | 590 |
589 dbus::MessageWriter hints_writer(nullptr); | 591 dbus::MessageWriter hints_writer(nullptr); |
590 writer.OpenArray("{sv}", &hints_writer); | 592 writer.OpenArray("{sv}", &hints_writer); |
591 dbus::MessageWriter urgency_writer(nullptr); | 593 dbus::MessageWriter urgency_writer(nullptr); |
592 hints_writer.OpenDictEntry(&urgency_writer); | 594 hints_writer.OpenDictEntry(&urgency_writer); |
593 urgency_writer.AppendString("urgency"); | 595 urgency_writer.AppendString("urgency"); |
594 urgency_writer.AppendVariantOfUint32( | 596 urgency_writer.AppendVariantOfUint32( |
595 NotificationPriorityToFdoUrgency(notification->priority())); | 597 NotificationPriorityToFdoUrgency(notification->priority())); |
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
903 } | 905 } |
904 | 906 |
905 void NotificationPlatformBridgeLinux::SetReadyCallback( | 907 void NotificationPlatformBridgeLinux::SetReadyCallback( |
906 NotificationBridgeReadyCallback callback) { | 908 NotificationBridgeReadyCallback callback) { |
907 impl_->SetReadyCallback(std::move(callback)); | 909 impl_->SetReadyCallback(std::move(callback)); |
908 } | 910 } |
909 | 911 |
910 void NotificationPlatformBridgeLinux::CleanUp() { | 912 void NotificationPlatformBridgeLinux::CleanUp() { |
911 impl_->CleanUp(); | 913 impl_->CleanUp(); |
912 } | 914 } |
OLD | NEW |