OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/threading/thread.h" | 8 #include "base/threading/thread.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "chrome/browser/content_settings/content_settings_provider.h" | 10 #include "chrome/browser/content_settings/content_settings_provider.h" |
(...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
584 } | 584 } |
585 return UTF8ToUTF16(origin.host()); | 585 return UTF8ToUTF16(origin.host()); |
586 } | 586 } |
587 | 587 |
588 void DesktopNotificationService::NotifySettingsChange() { | 588 void DesktopNotificationService::NotifySettingsChange() { |
589 NotificationService::current()->Notify( | 589 NotificationService::current()->Notify( |
590 NotificationType::DESKTOP_NOTIFICATION_SETTINGS_CHANGED, | 590 NotificationType::DESKTOP_NOTIFICATION_SETTINGS_CHANGED, |
591 Source<DesktopNotificationService>(this), | 591 Source<DesktopNotificationService>(this), |
592 NotificationService::NoDetails()); | 592 NotificationService::NoDetails()); |
593 } | 593 } |
| 594 |
| 595 int DesktopNotificationService::HasPermission(const GURL& origin) { |
| 596 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 597 return prefs_cache()->HasPermission(origin.GetOrigin()); |
| 598 } |
OLD | NEW |