| 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 "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/metrics/histogram_macros.h" | 8 #include "base/metrics/histogram_macros.h" |
| 9 #include "base/metrics/user_metrics_action.h" | 9 #include "base/metrics/user_metrics_action.h" |
| 10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
| (...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 380 l10n_util::GetStringUTF16(IDS_NOTIFICATION_SETTINGS)); | 380 l10n_util::GetStringUTF16(IDS_NOTIFICATION_SETTINGS)); |
| 381 settings_button.icon = | 381 settings_button.icon = |
| 382 ui::ResourceBundle::GetSharedInstance().GetImageNamed( | 382 ui::ResourceBundle::GetSharedInstance().GetImageNamed( |
| 383 IDR_NOTIFICATION_SETTINGS); | 383 IDR_NOTIFICATION_SETTINGS); |
| 384 buttons.push_back(settings_button); | 384 buttons.push_back(settings_button); |
| 385 } | 385 } |
| 386 #endif // !defined(OS_ANDROID) | 386 #endif // !defined(OS_ANDROID) |
| 387 | 387 |
| 388 notification.set_buttons(buttons); | 388 notification.set_buttons(buttons); |
| 389 | 389 |
| 390 notification.set_is_web_notification(true); |
| 391 |
| 390 // On desktop, notifications with require_interaction==true stay on-screen | 392 // On desktop, notifications with require_interaction==true stay on-screen |
| 391 // rather than minimizing to the notification center after a timeout. | 393 // rather than minimizing to the notification center after a timeout. |
| 392 // On mobile, this is ignored (notifications are minimized at all times). | 394 // On mobile, this is ignored (notifications are minimized at all times). |
| 393 if (notification_data.require_interaction) | 395 if (notification_data.require_interaction) |
| 394 notification.set_never_timeout(true); | 396 notification.set_never_timeout(true); |
| 395 | 397 |
| 396 return notification; | 398 return notification; |
| 397 } | 399 } |
| 398 | 400 |
| 399 NotificationUIManager* | 401 NotificationUIManager* |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 436 extensions::ExtensionRegistry::Get(profile)->GetExtensionById( | 438 extensions::ExtensionRegistry::Get(profile)->GetExtensionById( |
| 437 origin.host(), extensions::ExtensionRegistry::EVERYTHING); | 439 origin.host(), extensions::ExtensionRegistry::EVERYTHING); |
| 438 DCHECK(extension); | 440 DCHECK(extension); |
| 439 | 441 |
| 440 return base::UTF8ToUTF16(extension->name()); | 442 return base::UTF8ToUTF16(extension->name()); |
| 441 } | 443 } |
| 442 #endif | 444 #endif |
| 443 | 445 |
| 444 return base::string16(); | 446 return base::string16(); |
| 445 } | 447 } |
| OLD | NEW |