Turn on Synced Notification Sending services by default for all users, and save preferences.
This is for the new Synced Notification feature, which allows servers to send notification toasts to the chrome message center (also called the notification center).
As things stand today (before this checkin), Synced Notifications is enabled, but each data type from an individual server needs to be intentionally enabled by the user finding the notification center settings panel and clicking a check box for that service to the "enabled" state.
After lots of rounds of UI discussion we decided the best experience for the user is to default the sending services to enabled instead of the way it defaults to disabled today.
So, the goal of this checkin is just to change the state of the existing synced notification type from disabled to enabled by default.
As it turns out, it wasn't as easy as just changing false to true somewhere. We opted (after the first round of code review) for a scheme that maintains two preference lists, a list of enabled synced notification services (which we will now add our first sending service to, and in the future we plan to add other services), and a list of preferences that we have "initialized" (or basically turned them on by default once). We need the second list because we are turning the service on at runtime, and if the user later wants to turn the service off, we need to remember and not just turn it on again. I intended to describe this part adequately in my changelist, but apparently I didn't describe it well enough, and I'll try to amend the description.
BUG=280250
Review URL: https://chromiumcodereview.appspot.com/23534048
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@224080 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc
index 76ae923..4e7cc93 100644
--- a/chrome/browser/prefs/browser_prefs.cc
+++ b/chrome/browser/prefs/browser_prefs.cc
@@ -47,6 +47,9 @@
#include "chrome/browser/net/ssl_config_service_manager.h"
#include "chrome/browser/notifications/desktop_notification_service.h"
#include "chrome/browser/notifications/notification_prefs_manager.h"
+#if !defined(OS_ANDROID)
+#include "chrome/browser/notifications/sync_notifier/chrome_notifier_service.h"
+#endif // OS_ANDROID
#include "chrome/browser/password_manager/password_generation_manager.h"
#include "chrome/browser/password_manager/password_manager.h"
#include "chrome/browser/pepper_flash_settings_manager.h"
@@ -322,6 +325,9 @@
MediaStreamDevicesController::RegisterProfilePrefs(registry);
NetPrefObserver::RegisterProfilePrefs(registry);
NewTabUI::RegisterProfilePrefs(registry);
+#if !defined(OS_ANDROID)
+ notifier::ChromeNotifierService::RegisterProfilePrefs(registry);
+#endif // OS_ANDROID
PasswordGenerationManager::RegisterProfilePrefs(registry);
PasswordManager::RegisterProfilePrefs(registry);
PrefProxyConfigTrackerImpl::RegisterProfilePrefs(registry);