diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-18 00:18:09 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-18 00:18:09 +0000 |
commit | 7abc95294fd6bfd2bdd60733fa24de640b9f0bb2 (patch) | |
tree | 9ee1f42e6a0b4405b6f26957e0ec9514a3eb6ac3 /chrome/browser/notifications | |
parent | 41b946d3b39411c505f66a9dba6dc052d80dde88 (diff) | |
download | chromium_src-7abc95294fd6bfd2bdd60733fa24de640b9f0bb2.zip chromium_src-7abc95294fd6bfd2bdd60733fa24de640b9f0bb2.tar.gz chromium_src-7abc95294fd6bfd2bdd60733fa24de640b9f0bb2.tar.bz2 |
Move the little infobar code from TabContents to TabContentsWrapper.
BUG=76792
Review URL: http://codereview.chromium.org/7010017
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85703 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/notifications')
-rw-r--r-- | chrome/browser/notifications/desktop_notification_service.cc | 12 |
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); |