| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/media/midi_permission_infobar_delegate.h" | 5 #include "chrome/browser/media/midi_permission_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* MidiPermissionInfoBarDelegate::Create( | 15 infobars::InfoBar* MidiPermissionInfoBarDelegate::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 ContentSettingsType type) { | 21 ContentSettingsType type) { |
| (...skipping 16 matching lines...) Expand all Loading... |
| 38 MidiPermissionInfoBarDelegate::~MidiPermissionInfoBarDelegate() { | 38 MidiPermissionInfoBarDelegate::~MidiPermissionInfoBarDelegate() { |
| 39 } | 39 } |
| 40 | 40 |
| 41 int MidiPermissionInfoBarDelegate::GetIconID() const { | 41 int MidiPermissionInfoBarDelegate::GetIconID() const { |
| 42 return IDR_INFOBAR_MIDI; | 42 return IDR_INFOBAR_MIDI; |
| 43 } | 43 } |
| 44 | 44 |
| 45 base::string16 MidiPermissionInfoBarDelegate::GetMessageText() const { | 45 base::string16 MidiPermissionInfoBarDelegate::GetMessageText() const { |
| 46 return l10n_util::GetStringFUTF16( | 46 return l10n_util::GetStringFUTF16( |
| 47 IDS_MIDI_SYSEX_INFOBAR_QUESTION, | 47 IDS_MIDI_SYSEX_INFOBAR_QUESTION, |
| 48 net::FormatUrl(requesting_frame_.GetOrigin(), display_languages_, | 48 url_formatter::FormatUrl( |
| 49 net::kFormatUrlOmitUsernamePassword | | 49 requesting_frame_.GetOrigin(), display_languages_, |
| 50 net::kFormatUrlOmitTrailingSlashOnBareHostname, | 50 url_formatter::kFormatUrlOmitUsernamePassword | |
| 51 net::UnescapeRule::SPACES, NULL, NULL, NULL)); | 51 url_formatter::kFormatUrlOmitTrailingSlashOnBareHostname, |
| 52 net::UnescapeRule::SPACES, nullptr, nullptr, nullptr)); |
| 52 } | 53 } |
| OLD | NEW |