Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2304)

Unified Diff: chrome/browser/notifications/desktop_notification_service.cc

Issue 7810002: Move infobar handling to a tab helper. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixes Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/infobars/infobar_tab_helper.cc ('k') | chrome/browser/omnibox_search_hint.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/notifications/desktop_notification_service.cc
diff --git a/chrome/browser/notifications/desktop_notification_service.cc b/chrome/browser/notifications/desktop_notification_service.cc
index bd46686e5511dca4bd41ad284523918a89032984..89e7d38f560b87877b4f8a16930bb4527a60c7d1 100644
--- a/chrome/browser/notifications/desktop_notification_service.cc
+++ b/chrome/browser/notifications/desktop_notification_service.cc
@@ -12,6 +12,7 @@
#include "chrome/browser/content_settings/content_settings_provider.h"
#include "chrome/browser/content_settings/host_content_settings_map.h"
#include "chrome/browser/extensions/extension_service.h"
+#include "chrome/browser/infobars/infobar_tab_helper.h"
#include "chrome/browser/notifications/desktop_notification_service_factory.h"
#include "chrome/browser/notifications/notification.h"
#include "chrome/browser/notifications/notification_object_proxy.h"
@@ -337,9 +338,6 @@ 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,
@@ -347,7 +345,9 @@ void DesktopNotificationService::RequestPermission(
ContentSetting setting = GetContentSetting(origin);
if (setting == CONTENT_SETTING_ASK) {
// Show an info bar requesting permission.
- wrapper->AddInfoBar(
+ TabContentsWrapper* wrapper =
+ TabContentsWrapper::GetCurrentWrapperForContents(tab);
+ wrapper->infobar_tab_helper()->AddInfoBar(
new NotificationPermissionInfoBarDelegate(
tab, origin, DisplayNameForOrigin(origin), process_id,
route_id, callback_context));
« no previous file with comments | « chrome/browser/infobars/infobar_tab_helper.cc ('k') | chrome/browser/omnibox_search_hint.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698