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

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

Issue 22694006: Infobar system refactor. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years 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
Index: chrome/browser/notifications/desktop_notification_service.cc
===================================================================
--- chrome/browser/notifications/desktop_notification_service.cc (revision 238220)
+++ chrome/browser/notifications/desktop_notification_service.cc (working copy)
@@ -17,6 +17,7 @@
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/extensions/extension_system.h"
#include "chrome/browser/infobars/confirm_infobar_delegate.h"
+#include "chrome/browser/infobars/infobar.h"
#include "chrome/browser/infobars/infobar_service.h"
#include "chrome/browser/notifications/desktop_notification_service_factory.h"
#include "chrome/browser/notifications/notification.h"
@@ -67,8 +68,8 @@
// permissions.
class NotificationPermissionInfoBarDelegate : public ConfirmInfoBarDelegate {
public:
- // Creates a notification permission infobar delegate and adds it to
- // |infobar_service|.
+ // Creates a notification permission infobar and delegate and adds the infobar
+ // to |infobar_service|.
static void Create(InfoBarService* infobar_service,
DesktopNotificationService* notification_service,
const GURL& origin,
@@ -79,7 +80,6 @@
private:
NotificationPermissionInfoBarDelegate(
- InfoBarService* infobar_service,
DesktopNotificationService* notification_service,
const GURL& origin,
const string16& display_name,
@@ -127,14 +127,14 @@
int process_id,
int route_id,
int callback_context) {
- infobar_service->AddInfoBar(scoped_ptr<InfoBarDelegate>(
- new NotificationPermissionInfoBarDelegate(
- infobar_service, notification_service, origin, display_name,
- process_id, route_id, callback_context)));
+ infobar_service->AddInfoBar(ConfirmInfoBarDelegate::CreateInfoBar(
+ scoped_ptr<ConfirmInfoBarDelegate>(
+ new NotificationPermissionInfoBarDelegate(
+ notification_service, origin, display_name, process_id, route_id,
+ callback_context))));
}
NotificationPermissionInfoBarDelegate::NotificationPermissionInfoBarDelegate(
- InfoBarService* infobar_service,
DesktopNotificationService* notification_service,
const GURL& origin,
const string16& display_name,
@@ -141,7 +141,7 @@
int process_id,
int route_id,
int callback_context)
- : ConfirmInfoBarDelegate(infobar_service),
+ : ConfirmInfoBarDelegate(),
origin_(origin),
display_name_(display_name),
notification_service_(notification_service),
« no previous file with comments | « chrome/browser/nacl_host/nacl_infobar_delegate.cc ('k') | chrome/browser/notifications/notification_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698