| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/desktop_notification_service.h" | 5 #include "chrome/browser/notifications/desktop_notification_service.h" |
| 6 | 6 |
| 7 #include "base/metrics/histogram.h" | 7 #include "base/metrics/histogram.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "base/threading/thread.h" | 9 #include "base/threading/thread.h" |
| 10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 UMA_HISTOGRAM_COUNTS("NotificationPermissionRequest.Denied", 1); | 190 UMA_HISTOGRAM_COUNTS("NotificationPermissionRequest.Denied", 1); |
| 191 notification_service_->DenyPermission(origin_); | 191 notification_service_->DenyPermission(origin_); |
| 192 action_taken_ = true; | 192 action_taken_ = true; |
| 193 return true; | 193 return true; |
| 194 } | 194 } |
| 195 | 195 |
| 196 | 196 |
| 197 // DesktopNotificationService ------------------------------------------------- | 197 // DesktopNotificationService ------------------------------------------------- |
| 198 | 198 |
| 199 // static | 199 // static |
| 200 void DesktopNotificationService::RegisterUserPrefs( | 200 void DesktopNotificationService::RegisterProfilePrefs( |
| 201 user_prefs::PrefRegistrySyncable* registry) { | 201 user_prefs::PrefRegistrySyncable* registry) { |
| 202 registry->RegisterListPref(prefs::kMessageCenterDisabledExtensionIds, | 202 registry->RegisterListPref(prefs::kMessageCenterDisabledExtensionIds, |
| 203 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 203 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 204 registry->RegisterListPref(prefs::kMessageCenterDisabledSystemComponentIds, | 204 registry->RegisterListPref(prefs::kMessageCenterDisabledSystemComponentIds, |
| 205 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 205 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 206 registry->RegisterListPref(prefs::kMessageCenterEnabledSyncNotifierIds, | 206 registry->RegisterListPref(prefs::kMessageCenterEnabledSyncNotifierIds, |
| 207 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 207 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 208 } | 208 } |
| 209 | 209 |
| 210 // static | 210 // static |
| (...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 672 DCHECK_EQ(chrome::NOTIFICATION_EXTENSION_UNINSTALLED, type); | 672 DCHECK_EQ(chrome::NOTIFICATION_EXTENSION_UNINSTALLED, type); |
| 673 | 673 |
| 674 extensions::Extension* extension = | 674 extensions::Extension* extension = |
| 675 content::Details<extensions::Extension>(details).ptr(); | 675 content::Details<extensions::Extension>(details).ptr(); |
| 676 NotifierId notifier_id(NotifierId::APPLICATION, extension->id()); | 676 NotifierId notifier_id(NotifierId::APPLICATION, extension->id()); |
| 677 if (IsNotifierEnabled(notifier_id)) | 677 if (IsNotifierEnabled(notifier_id)) |
| 678 return; | 678 return; |
| 679 | 679 |
| 680 SetNotifierEnabled(notifier_id, true); | 680 SetNotifierEnabled(notifier_id, true); |
| 681 } | 681 } |
| OLD | NEW |