| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/platform_notification_service_impl.h" | 5 #include "chrome/browser/notifications/platform_notification_service_impl.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 476 gfx::Image::CreateFrom1xBitmap(notification_resources.notification_icon), | 476 gfx::Image::CreateFrom1xBitmap(notification_resources.notification_icon), |
| 477 message_center::NotifierId(origin), base::UTF8ToUTF16(origin.host()), | 477 message_center::NotifierId(origin), base::UTF8ToUTF16(origin.host()), |
| 478 origin, notification_data.tag, message_center::RichNotificationData(), | 478 origin, notification_data.tag, message_center::RichNotificationData(), |
| 479 delegate); | 479 delegate); |
| 480 | 480 |
| 481 notification.set_context_message( | 481 notification.set_context_message( |
| 482 DisplayNameForContextMessage(profile, origin)); | 482 DisplayNameForContextMessage(profile, origin)); |
| 483 notification.set_vibration_pattern(notification_data.vibration_pattern); | 483 notification.set_vibration_pattern(notification_data.vibration_pattern); |
| 484 notification.set_timestamp(notification_data.timestamp); | 484 notification.set_timestamp(notification_data.timestamp); |
| 485 notification.set_silent(notification_data.silent); | 485 notification.set_silent(notification_data.silent); |
| 486 notification.set_renotify(notification_data.renotify); |
| 486 | 487 |
| 487 std::vector<message_center::ButtonInfo> buttons; | 488 std::vector<message_center::ButtonInfo> buttons; |
| 488 | 489 |
| 489 // Developer supplied buttons. | 490 // Developer supplied buttons. |
| 490 for (const auto& action : notification_data.actions) | 491 for (const auto& action : notification_data.actions) |
| 491 buttons.push_back(message_center::ButtonInfo(action.title)); | 492 buttons.push_back(message_center::ButtonInfo(action.title)); |
| 492 | 493 |
| 493 notification.set_buttons(buttons); | 494 notification.set_buttons(buttons); |
| 494 | 495 |
| 495 // On desktop, notifications with require_interaction==true stay on-screen | 496 // On desktop, notifications with require_interaction==true stay on-screen |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 550 extensions::ExtensionRegistry::Get(profile)->GetExtensionById( | 551 extensions::ExtensionRegistry::Get(profile)->GetExtensionById( |
| 551 origin.host(), extensions::ExtensionRegistry::EVERYTHING); | 552 origin.host(), extensions::ExtensionRegistry::EVERYTHING); |
| 552 DCHECK(extension); | 553 DCHECK(extension); |
| 553 | 554 |
| 554 return base::UTF8ToUTF16(extension->name()); | 555 return base::UTF8ToUTF16(extension->name()); |
| 555 } | 556 } |
| 556 #endif | 557 #endif |
| 557 | 558 |
| 558 return base::string16(); | 559 return base::string16(); |
| 559 } | 560 } |
| OLD | NEW |