summaryrefslogtreecommitdiffstats
path: root/chrome/browser/notifications/desktop_notification_service.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/notifications/desktop_notification_service.cc')
-rw-r--r--chrome/browser/notifications/desktop_notification_service.cc12
1 files changed, 8 insertions, 4 deletions
diff --git a/chrome/browser/notifications/desktop_notification_service.cc b/chrome/browser/notifications/desktop_notification_service.cc
index 0d2711f..6241808 100644
--- a/chrome/browser/notifications/desktop_notification_service.cc
+++ b/chrome/browser/notifications/desktop_notification_service.cc
@@ -20,6 +20,7 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/tab_contents/confirm_infobar_delegate.h"
#include "chrome/browser/ui/browser_list.h"
+#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/url_constants.h"
#include "content/browser/browser_child_process_host.h"
@@ -27,7 +28,6 @@
#include "content/browser/renderer_host/render_process_host.h"
#include "content/browser/renderer_host/render_view_host.h"
#include "content/browser/site_instance.h"
-#include "content/browser/tab_contents/tab_contents.h"
#include "content/browser/worker_host/worker_process_host.h"
#include "content/common/desktop_notification_messages.h"
#include "content/common/notification_service.h"
@@ -508,6 +508,9 @@ void DesktopNotificationService::RequestPermission(
if (!tab)
return;
+ TabContentsWrapper* wrapper =
+ TabContentsWrapper::GetCurrentWrapperForContents(tab);
+
// If |origin| hasn't been seen before and the default content setting for
// notifications is "ask", show an infobar.
// The cache can only answer queries on the IO thread once it's initialized,
@@ -515,9 +518,10 @@ void DesktopNotificationService::RequestPermission(
ContentSetting setting = GetContentSetting(origin);
if (setting == CONTENT_SETTING_ASK) {
// Show an info bar requesting permission.
- tab->AddInfoBar(new NotificationPermissionInfoBarDelegate(
- tab, origin, DisplayNameForOrigin(origin), process_id,
- route_id, callback_context));
+ wrapper->AddInfoBar(
+ new NotificationPermissionInfoBarDelegate(
+ tab, origin, DisplayNameForOrigin(origin), process_id,
+ route_id, callback_context));
} else {
// Notify renderer immediately.
RenderViewHost* host = RenderViewHost::FromID(process_id, route_id);