| 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_android.h" | 5 #include "chrome/browser/media/midi_permission_infobar_delegate_android.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" | |
| 9 #include "chrome/grit/generated_resources.h" | 8 #include "chrome/grit/generated_resources.h" |
| 10 #include "components/infobars/core/infobar.h" | |
| 11 | |
| 12 // static | |
| 13 infobars::InfoBar* MidiPermissionInfoBarDelegateAndroid::Create( | |
| 14 InfoBarService* infobar_service, | |
| 15 const GURL& requesting_frame, | |
| 16 bool user_gesture, | |
| 17 Profile* profile, | |
| 18 const PermissionSetCallback& callback) { | |
| 19 return infobar_service->AddInfoBar( | |
| 20 CreatePermissionInfoBar(std::unique_ptr<PermissionInfoBarDelegate>( | |
| 21 new MidiPermissionInfoBarDelegateAndroid( | |
| 22 requesting_frame, user_gesture, profile, callback)))); | |
| 23 } | |
| 24 | 9 |
| 25 MidiPermissionInfoBarDelegateAndroid::MidiPermissionInfoBarDelegateAndroid( | 10 MidiPermissionInfoBarDelegateAndroid::MidiPermissionInfoBarDelegateAndroid( |
| 26 const GURL& requesting_frame, | 11 const GURL& requesting_frame, |
| 27 bool user_gesture, | 12 bool user_gesture, |
| 28 Profile* profile, | 13 Profile* profile, |
| 29 const PermissionSetCallback& callback) | 14 const PermissionSetCallback& callback) |
| 30 : PermissionInfoBarDelegate(requesting_frame, | 15 : PermissionInfoBarDelegate(requesting_frame, |
| 31 content::PermissionType::MIDI_SYSEX, | 16 content::PermissionType::MIDI_SYSEX, |
| 32 CONTENT_SETTINGS_TYPE_MIDI_SYSEX, | 17 CONTENT_SETTINGS_TYPE_MIDI_SYSEX, |
| 33 user_gesture, | 18 user_gesture, |
| 34 profile, | 19 profile, |
| 35 callback) {} | 20 callback) {} |
| 36 | 21 |
| 37 MidiPermissionInfoBarDelegateAndroid::~MidiPermissionInfoBarDelegateAndroid() {} | 22 MidiPermissionInfoBarDelegateAndroid::~MidiPermissionInfoBarDelegateAndroid() {} |
| 38 | 23 |
| 39 infobars::InfoBarDelegate::InfoBarIdentifier | 24 infobars::InfoBarDelegate::InfoBarIdentifier |
| 40 MidiPermissionInfoBarDelegateAndroid::GetIdentifier() const { | 25 MidiPermissionInfoBarDelegateAndroid::GetIdentifier() const { |
| 41 return MIDI_PERMISSION_INFOBAR_DELEGATE_ANDROID; | 26 return MIDI_PERMISSION_INFOBAR_DELEGATE_ANDROID; |
| 42 } | 27 } |
| 43 | 28 |
| 44 int MidiPermissionInfoBarDelegateAndroid::GetIconId() const { | 29 int MidiPermissionInfoBarDelegateAndroid::GetIconId() const { |
| 45 return IDR_ANDROID_INFOBAR_MIDI; | 30 return IDR_ANDROID_INFOBAR_MIDI; |
| 46 } | 31 } |
| 47 | 32 |
| 48 int MidiPermissionInfoBarDelegateAndroid::GetMessageResourceId() const { | 33 int MidiPermissionInfoBarDelegateAndroid::GetMessageResourceId() const { |
| 49 return IDS_MIDI_SYSEX_INFOBAR_QUESTION; | 34 return IDS_MIDI_SYSEX_INFOBAR_QUESTION; |
| 50 } | 35 } |
| OLD | NEW |