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/bind.h" | 7 #include "base/bind.h" |
8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
9 #include "base/metrics/histogram_macros.h" | 9 #include "base/metrics/histogram_macros.h" |
10 #include "base/prefs/scoped_user_pref_update.h" | 10 #include "base/prefs/scoped_user_pref_update.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 #endif | 38 #endif |
39 | 39 |
40 using content::BrowserThread; | 40 using content::BrowserThread; |
41 using message_center::NotifierId; | 41 using message_center::NotifierId; |
42 | 42 |
43 // DesktopNotificationService ------------------------------------------------- | 43 // DesktopNotificationService ------------------------------------------------- |
44 | 44 |
45 // static | 45 // static |
46 void DesktopNotificationService::RegisterProfilePrefs( | 46 void DesktopNotificationService::RegisterProfilePrefs( |
47 user_prefs::PrefRegistrySyncable* registry) { | 47 user_prefs::PrefRegistrySyncable* registry) { |
48 registry->RegisterListPref( | 48 registry->RegisterListPref(prefs::kMessageCenterDisabledExtensionIds); |
49 prefs::kMessageCenterDisabledExtensionIds, | 49 registry->RegisterListPref(prefs::kMessageCenterDisabledSystemComponentIds); |
50 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | |
51 registry->RegisterListPref( | |
52 prefs::kMessageCenterDisabledSystemComponentIds, | |
53 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | |
54 } | 50 } |
55 | 51 |
56 DesktopNotificationService::DesktopNotificationService(Profile* profile) | 52 DesktopNotificationService::DesktopNotificationService(Profile* profile) |
57 : PermissionContextBase(profile, CONTENT_SETTINGS_TYPE_NOTIFICATIONS), | 53 : PermissionContextBase(profile, CONTENT_SETTINGS_TYPE_NOTIFICATIONS), |
58 profile_(profile) | 54 profile_(profile) |
59 #if defined(ENABLE_EXTENSIONS) | 55 #if defined(ENABLE_EXTENSIONS) |
60 , | 56 , |
61 extension_registry_observer_(this) | 57 extension_registry_observer_(this) |
62 #endif | 58 #endif |
63 { | 59 { |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 // Tell the IO thread that this extension's permission for notifications | 272 // Tell the IO thread that this extension's permission for notifications |
277 // has changed. | 273 // has changed. |
278 extensions::InfoMap* extension_info_map = | 274 extensions::InfoMap* extension_info_map = |
279 extensions::ExtensionSystem::Get(profile_)->info_map(); | 275 extensions::ExtensionSystem::Get(profile_)->info_map(); |
280 BrowserThread::PostTask( | 276 BrowserThread::PostTask( |
281 BrowserThread::IO, FROM_HERE, | 277 BrowserThread::IO, FROM_HERE, |
282 base::Bind(&extensions::InfoMap::SetNotificationsDisabled, | 278 base::Bind(&extensions::InfoMap::SetNotificationsDisabled, |
283 extension_info_map, notifier_id.id, !enabled)); | 279 extension_info_map, notifier_id.id, !enabled)); |
284 #endif | 280 #endif |
285 } | 281 } |
OLD | NEW |