Chromium Code Reviews| 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 15 matching lines...) Expand all Loading... | |
| 26 #include "chrome/browser/profiles/profile_manager.h" | 26 #include "chrome/browser/profiles/profile_manager.h" |
| 27 #include "chrome/browser/ui/browser.h" | 27 #include "chrome/browser/ui/browser.h" |
| 28 #include "chrome/browser/ui/chrome_pages.h" | 28 #include "chrome/browser/ui/chrome_pages.h" |
| 29 #include "chrome/browser/ui/scoped_tabbed_browser_displayer.h" | 29 #include "chrome/browser/ui/scoped_tabbed_browser_displayer.h" |
| 30 #include "chrome/common/chrome_switches.h" | 30 #include "chrome/common/chrome_switches.h" |
| 31 #include "chrome/common/pref_names.h" | 31 #include "chrome/common/pref_names.h" |
| 32 #include "chrome/grit/generated_resources.h" | 32 #include "chrome/grit/generated_resources.h" |
| 33 #include "components/content_settings/core/browser/host_content_settings_map.h" | 33 #include "components/content_settings/core/browser/host_content_settings_map.h" |
| 34 #include "components/content_settings/core/common/content_settings.h" | 34 #include "components/content_settings/core/common/content_settings.h" |
| 35 #include "components/content_settings/core/common/content_settings_types.h" | 35 #include "components/content_settings/core/common/content_settings_types.h" |
| 36 #include "components/pref_registry/pref_registry_syncable.h" | |
| 36 #include "components/prefs/pref_service.h" | 37 #include "components/prefs/pref_service.h" |
| 37 #include "components/url_formatter/url_formatter.h" | 38 #include "components/url_formatter/url_formatter.h" |
| 38 #include "content/public/browser/browser_thread.h" | 39 #include "content/public/browser/browser_thread.h" |
| 39 #include "content/public/browser/desktop_notification_delegate.h" | 40 #include "content/public/browser/desktop_notification_delegate.h" |
| 40 #include "content/public/browser/notification_event_dispatcher.h" | 41 #include "content/public/browser/notification_event_dispatcher.h" |
| 41 #include "content/public/browser/platform_notification_context.h" | 42 #include "content/public/browser/platform_notification_context.h" |
| 42 #include "content/public/browser/storage_partition.h" | 43 #include "content/public/browser/storage_partition.h" |
| 43 #include "content/public/browser/user_metrics.h" | 44 #include "content/public/browser/user_metrics.h" |
| 44 #include "content/public/common/notification_resources.h" | 45 #include "content/public/common/notification_resources.h" |
| 45 #include "content/public/common/platform_notification_data.h" | 46 #include "content/public/common/platform_notification_data.h" |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 139 DCHECK(profile_manager); | 140 DCHECK(profile_manager); |
| 140 profile_manager->LoadProfile( | 141 profile_manager->LoadProfile( |
| 141 profile_id, incognito, | 142 profile_id, incognito, |
| 142 base::Bind(&OnCloseNonPersistentNotificationProfileLoaded, | 143 base::Bind(&OnCloseNonPersistentNotificationProfileLoaded, |
| 143 notification_id)); | 144 notification_id)); |
| 144 } | 145 } |
| 145 | 146 |
| 146 } // namespace | 147 } // namespace |
| 147 | 148 |
| 148 // static | 149 // static |
| 150 void PlatformNotificationServiceImpl::RegisterProfilePrefs( | |
| 151 user_prefs::PrefRegistrySyncable* registry) { | |
| 152 #if defined(OS_ANDROID) | |
| 153 registry->RegisterBooleanPref(prefs::kNotificationsVibrateEnabled, true); | |
|
Peter Beverloo
2016/06/07 12:46:01
Should this be part of the NotificationPlatformBri
Michael van Ouwerkerk
2016/06/07 16:34:21
Done.
| |
| 154 #endif | |
| 155 } | |
| 156 | |
| 157 // static | |
| 149 PlatformNotificationServiceImpl* | 158 PlatformNotificationServiceImpl* |
| 150 PlatformNotificationServiceImpl::GetInstance() { | 159 PlatformNotificationServiceImpl::GetInstance() { |
| 151 return base::Singleton<PlatformNotificationServiceImpl>::get(); | 160 return base::Singleton<PlatformNotificationServiceImpl>::get(); |
| 152 } | 161 } |
| 153 | 162 |
| 154 PlatformNotificationServiceImpl::PlatformNotificationServiceImpl() | 163 PlatformNotificationServiceImpl::PlatformNotificationServiceImpl() |
| 155 : test_display_service_(nullptr) {} | 164 : test_display_service_(nullptr) {} |
| 156 | 165 |
| 157 PlatformNotificationServiceImpl::~PlatformNotificationServiceImpl() {} | 166 PlatformNotificationServiceImpl::~PlatformNotificationServiceImpl() {} |
| 158 | 167 |
| (...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 544 } | 553 } |
| 545 #endif | 554 #endif |
| 546 | 555 |
| 547 return base::string16(); | 556 return base::string16(); |
| 548 } | 557 } |
| 549 | 558 |
| 550 void PlatformNotificationServiceImpl::SetNotificationDisplayServiceForTesting( | 559 void PlatformNotificationServiceImpl::SetNotificationDisplayServiceForTesting( |
| 551 NotificationDisplayService* display_service) { | 560 NotificationDisplayService* display_service) { |
| 552 test_display_service_ = display_service; | 561 test_display_service_ = display_service; |
| 553 } | 562 } |
| OLD | NEW |