OLD | NEW |
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/desktop_notification_infobar_delegate.h" | 5 #include "chrome/browser/notifications/desktop_notification_infobar_delegate.h" |
6 | 6 |
7 #include "chrome/browser/infobars/infobar_service.h" | 7 #include "chrome/browser/infobars/infobar_service.h" |
8 #include "chrome/grit/generated_resources.h" | 8 #include "chrome/grit/generated_resources.h" |
9 #include "components/infobars/core/infobar.h" | 9 #include "components/infobars/core/infobar.h" |
| 10 #include "components/url_formatter/url_formatter.h" |
10 #include "grit/theme_resources.h" | 11 #include "grit/theme_resources.h" |
11 #include "net/base/net_util.h" | |
12 #include "ui/base/l10n/l10n_util.h" | 12 #include "ui/base/l10n/l10n_util.h" |
13 | 13 |
14 // static | 14 // static |
15 infobars::InfoBar* DesktopNotificationInfoBarDelegate::Create( | 15 infobars::InfoBar* DesktopNotificationInfoBarDelegate::Create( |
16 InfoBarService* infobar_service, | 16 InfoBarService* infobar_service, |
17 PermissionQueueController* controller, | 17 PermissionQueueController* controller, |
18 const PermissionRequestID& id, | 18 const PermissionRequestID& id, |
19 const GURL& requesting_frame, | 19 const GURL& requesting_frame, |
20 const std::string& display_languages) { | 20 const std::string& display_languages) { |
21 return infobar_service->AddInfoBar(infobar_service->CreateConfirmInfoBar( | 21 return infobar_service->AddInfoBar(infobar_service->CreateConfirmInfoBar( |
(...skipping 15 matching lines...) Expand all Loading... |
37 DesktopNotificationInfoBarDelegate::~DesktopNotificationInfoBarDelegate() { | 37 DesktopNotificationInfoBarDelegate::~DesktopNotificationInfoBarDelegate() { |
38 } | 38 } |
39 | 39 |
40 int DesktopNotificationInfoBarDelegate::GetIconID() const { | 40 int DesktopNotificationInfoBarDelegate::GetIconID() const { |
41 return IDR_INFOBAR_DESKTOP_NOTIFICATIONS; | 41 return IDR_INFOBAR_DESKTOP_NOTIFICATIONS; |
42 } | 42 } |
43 | 43 |
44 base::string16 DesktopNotificationInfoBarDelegate::GetMessageText() const { | 44 base::string16 DesktopNotificationInfoBarDelegate::GetMessageText() const { |
45 return l10n_util::GetStringFUTF16( | 45 return l10n_util::GetStringFUTF16( |
46 IDS_NOTIFICATION_PERMISSIONS, | 46 IDS_NOTIFICATION_PERMISSIONS, |
47 net::FormatUrl(requesting_frame_.GetOrigin(), display_languages_, | 47 url_formatter::FormatUrl( |
48 net::kFormatUrlOmitUsernamePassword | | 48 requesting_frame_.GetOrigin(), display_languages_, |
49 net::kFormatUrlOmitTrailingSlashOnBareHostname, | 49 url_formatter::kFormatUrlOmitUsernamePassword | |
50 net::UnescapeRule::SPACES, NULL, NULL, NULL)); | 50 url_formatter::kFormatUrlOmitTrailingSlashOnBareHostname, |
| 51 net::UnescapeRule::SPACES, nullptr, nullptr, nullptr)); |
51 } | 52 } |
OLD | NEW |