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

Unified Diff: chrome/browser/media/midi_permission_infobar_delegate.cc

Issue 365123003: Implement midi permissions on top of the new common permission classes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/media/midi_permission_infobar_delegate.cc
diff --git a/chrome/browser/media/midi_permission_infobar_delegate.cc b/chrome/browser/media/midi_permission_infobar_delegate.cc
index 4db9682878d9b4e32c2dc914214427d2abb65568..394b284ae2f712684033a52199423ceb4ce6227b 100644
--- a/chrome/browser/media/midi_permission_infobar_delegate.cc
+++ b/chrome/browser/media/midi_permission_infobar_delegate.cc
@@ -38,38 +38,18 @@ MidiPermissionInfoBarDelegate::MidiPermissionInfoBarDelegate(
const GURL& requesting_frame,
int contents_unique_id,
const std::string& display_languages)
- : ConfirmInfoBarDelegate(),
- controller_(controller),
- id_(id),
+ : PermissionInfobarDelegate(controller, id, requesting_frame),
requesting_frame_(requesting_frame),
- contents_unique_id_(contents_unique_id),
display_languages_(display_languages) {
}
MidiPermissionInfoBarDelegate::~MidiPermissionInfoBarDelegate() {
}
-void MidiPermissionInfoBarDelegate::InfoBarDismissed() {
- SetPermission(false, false);
-}
-
int MidiPermissionInfoBarDelegate::GetIconID() const {
return IDR_INFOBAR_MIDI;
}
-infobars::InfoBarDelegate::Type MidiPermissionInfoBarDelegate::GetInfoBarType()
- const {
- return PAGE_ACTION_TYPE;
-}
-
-bool MidiPermissionInfoBarDelegate::ShouldExpireInternal(
- const NavigationDetails& details) const {
- // This implementation matches InfoBarDelegate::ShouldExpireInternal(), but
- // uses the unique ID we set in the constructor instead of that stored in the
- // base class.
- return (contents_unique_id_ != details.entry_id) || details.is_reload;
-}
-
base::string16 MidiPermissionInfoBarDelegate::GetMessageText() const {
return l10n_util::GetStringFUTF16(
IDS_MIDI_SYSEX_INFOBAR_QUESTION,
@@ -78,27 +58,3 @@ base::string16 MidiPermissionInfoBarDelegate::GetMessageText() const {
net::kFormatUrlOmitTrailingSlashOnBareHostname,
net::UnescapeRule::SPACES, NULL, NULL, NULL));
}
-
-base::string16 MidiPermissionInfoBarDelegate::GetButtonLabel(
- InfoBarButton button) const {
- return l10n_util::GetStringUTF16((button == BUTTON_OK) ?
- IDS_MIDI_SYSEX_ALLOW_BUTTON : IDS_MIDI_SYSEX_DENY_BUTTON);
-}
-
-bool MidiPermissionInfoBarDelegate::Accept() {
- SetPermission(true, true);
- return true;
-}
-
-bool MidiPermissionInfoBarDelegate::Cancel() {
- SetPermission(true, false);
- return true;
-}
-
-void MidiPermissionInfoBarDelegate::SetPermission(bool update_content_setting,
- bool allowed) {
- content::WebContents* web_contents =
- InfoBarService::WebContentsFromInfoBar(infobar());
- controller_->OnPermissionSet(id_, requesting_frame_, web_contents->GetURL(),
- update_content_setting, allowed);
-}
« no previous file with comments | « chrome/browser/media/midi_permission_infobar_delegate.h ('k') | chrome/browser/services/gcm/permission_bubble_request_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698