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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 NotificationPermissionInfoBarDelegate::NotificationPermissionInfoBarDelegate( | 133 NotificationPermissionInfoBarDelegate::NotificationPermissionInfoBarDelegate( |
134 TabContents* contents, | 134 TabContents* contents, |
135 const GURL& origin, | 135 const GURL& origin, |
136 const string16& display_name, | 136 const string16& display_name, |
137 int process_id, | 137 int process_id, |
138 int route_id, | 138 int route_id, |
139 int callback_context) | 139 int callback_context) |
140 : ConfirmInfoBarDelegate(contents), | 140 : ConfirmInfoBarDelegate(contents), |
141 origin_(origin), | 141 origin_(origin), |
142 display_name_(display_name), | 142 display_name_(display_name), |
143 profile_(contents->profile()), | 143 profile_(static_cast<Profile*>(contents->context())), |
144 process_id_(process_id), | 144 process_id_(process_id), |
145 route_id_(route_id), | 145 route_id_(route_id), |
146 callback_context_(callback_context), | 146 callback_context_(callback_context), |
147 action_taken_(false) { | 147 action_taken_(false) { |
148 } | 148 } |
149 | 149 |
150 NotificationPermissionInfoBarDelegate:: | 150 NotificationPermissionInfoBarDelegate:: |
151 ~NotificationPermissionInfoBarDelegate() { | 151 ~NotificationPermissionInfoBarDelegate() { |
152 if (!action_taken_) | 152 if (!action_taken_) |
153 UMA_HISTOGRAM_COUNTS("NotificationPermissionRequest.Ignored", 1); | 153 UMA_HISTOGRAM_COUNTS("NotificationPermissionRequest.Ignored", 1); |
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
584 chrome::NOTIFICATION_DESKTOP_NOTIFICATION_SETTINGS_CHANGED, | 584 chrome::NOTIFICATION_DESKTOP_NOTIFICATION_SETTINGS_CHANGED, |
585 Source<DesktopNotificationService>(this), | 585 Source<DesktopNotificationService>(this), |
586 NotificationService::NoDetails()); | 586 NotificationService::NoDetails()); |
587 } | 587 } |
588 | 588 |
589 WebKit::WebNotificationPresenter::Permission | 589 WebKit::WebNotificationPresenter::Permission |
590 DesktopNotificationService::HasPermission(const GURL& origin) { | 590 DesktopNotificationService::HasPermission(const GURL& origin) { |
591 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 591 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
592 return prefs_cache()->HasPermission(origin.GetOrigin()); | 592 return prefs_cache()->HasPermission(origin.GetOrigin()); |
593 } | 593 } |
OLD | NEW |