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

Side by Side Diff: chrome/browser/notifications/notification_permission_infobar_delegate.cc

Issue 2069343002: Pass profile to PermissionUmaUtil::PermissionIgnored (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@add-hooks-to-permission-layer
Patch Set: Rebase Created 4 years, 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/notification_permission_infobar_delegate. h" 5 #include "chrome/browser/notifications/notification_permission_infobar_delegate. h"
6 6
7 #include "chrome/browser/android/android_theme_resources.h" 7 #include "chrome/browser/android/android_theme_resources.h"
8 #include "chrome/browser/infobars/infobar_service.h" 8 #include "chrome/browser/infobars/infobar_service.h"
9 #include "chrome/grit/generated_resources.h" 9 #include "chrome/grit/generated_resources.h"
10 #include "components/infobars/core/infobar.h" 10 #include "components/infobars/core/infobar.h"
11 11
12 // static 12 // static
13 infobars::InfoBar* NotificationPermissionInfobarDelegate::Create( 13 infobars::InfoBar* NotificationPermissionInfobarDelegate::Create(
14 InfoBarService* infobar_service, 14 InfoBarService* infobar_service,
15 const GURL& requesting_frame, 15 const GURL& requesting_frame,
16 Profile* profile,
16 const base::Callback<void(bool, bool)>& callback) { 17 const base::Callback<void(bool, bool)>& callback) {
17 return infobar_service->AddInfoBar(infobar_service->CreateConfirmInfoBar( 18 return infobar_service->AddInfoBar(infobar_service->CreateConfirmInfoBar(
18 std::unique_ptr<ConfirmInfoBarDelegate>( 19 std::unique_ptr<ConfirmInfoBarDelegate>(
19 new NotificationPermissionInfobarDelegate(requesting_frame, 20 new NotificationPermissionInfobarDelegate(requesting_frame, profile,
20 callback)))); 21 callback))));
21 } 22 }
22 23
23 NotificationPermissionInfobarDelegate::NotificationPermissionInfobarDelegate( 24 NotificationPermissionInfobarDelegate::NotificationPermissionInfobarDelegate(
24 const GURL& requesting_frame, 25 const GURL& requesting_frame,
26 Profile* profile,
25 const base::Callback<void(bool, bool)>& callback) 27 const base::Callback<void(bool, bool)>& callback)
26 : PermissionInfobarDelegate(requesting_frame, 28 : PermissionInfobarDelegate(requesting_frame,
27 content::PermissionType::NOTIFICATIONS, 29 content::PermissionType::NOTIFICATIONS,
28 CONTENT_SETTINGS_TYPE_NOTIFICATIONS, 30 CONTENT_SETTINGS_TYPE_NOTIFICATIONS,
31 profile,
29 callback), 32 callback),
30 requesting_frame_(requesting_frame) {} 33 requesting_frame_(requesting_frame) {}
31 34
32 NotificationPermissionInfobarDelegate::~NotificationPermissionInfobarDelegate() 35 NotificationPermissionInfobarDelegate::~NotificationPermissionInfobarDelegate()
33 {} 36 {}
34 37
35 infobars::InfoBarDelegate::InfoBarIdentifier 38 infobars::InfoBarDelegate::InfoBarIdentifier
36 NotificationPermissionInfobarDelegate::GetIdentifier() const { 39 NotificationPermissionInfobarDelegate::GetIdentifier() const {
37 return NOTIFICATION_PERMISSION_INFOBAR_DELEGATE; 40 return NOTIFICATION_PERMISSION_INFOBAR_DELEGATE;
38 } 41 }
39 42
40 int NotificationPermissionInfobarDelegate::GetIconId() const { 43 int NotificationPermissionInfobarDelegate::GetIconId() const {
41 return IDR_ANDROID_INFOBAR_NOTIFICATIONS; 44 return IDR_ANDROID_INFOBAR_NOTIFICATIONS;
42 } 45 }
43 46
44 int NotificationPermissionInfobarDelegate::GetMessageResourceId() const { 47 int NotificationPermissionInfobarDelegate::GetMessageResourceId() const {
45 return IDS_NOTIFICATION_PERMISSIONS; 48 return IDS_NOTIFICATION_PERMISSIONS;
46 } 49 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698