Chromium Code Reviews| 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/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 "grit/theme_resources.h" | 10 #include "grit/theme_resources.h" |
| 11 | 11 |
| 12 // static | 12 // static |
| 13 infobars::InfoBar* MidiPermissionInfoBarDelegateAndroid::Create( | 13 infobars::InfoBar* MidiPermissionInfoBarDelegateAndroid::Create( |
| 14 InfoBarService* infobar_service, | 14 InfoBarService* infobar_service, |
| 15 const GURL& requesting_frame, | 15 const GURL& requesting_frame, |
| 16 Profile* profile, | 16 Profile* profile, |
| 17 const PermissionSetCallback& callback) { | 17 const PermissionSetCallback& callback) { |
| 18 return infobar_service->AddInfoBar(infobar_service->CreateConfirmInfoBar( | 18 return infobar_service->AddInfoBar(infobar_service->CreateConfirmInfoBar( |
| 19 std::unique_ptr<ConfirmInfoBarDelegate>( | 19 std::unique_ptr<ConfirmInfoBarDelegate>( |
| 20 new MidiPermissionInfoBarDelegateAndroid(requesting_frame, profile, | 20 new MidiPermissionInfoBarDelegateAndroid(requesting_frame, |
| 21 callback)))); | 21 profile, callback)))); |
|
Sergey Ulanov
2016/07/21 19:32:47
nit: don't need this formatting change, and I thin
stefanocs
2016/07/22 00:56:11
Done. Sorry I changed this and then decided to mov
| |
| 22 } | 22 } |
| 23 | 23 |
| 24 MidiPermissionInfoBarDelegateAndroid::MidiPermissionInfoBarDelegateAndroid( | 24 MidiPermissionInfoBarDelegateAndroid::MidiPermissionInfoBarDelegateAndroid( |
| 25 const GURL& requesting_frame, | 25 const GURL& requesting_frame, |
| 26 Profile* profile, | 26 Profile* profile, |
| 27 const PermissionSetCallback& callback) | 27 const PermissionSetCallback& callback) |
| 28 : PermissionInfobarDelegate(requesting_frame, | 28 : PermissionInfobarDelegate(requesting_frame, |
| 29 content::PermissionType::MIDI_SYSEX, | 29 content::PermissionType::MIDI_SYSEX, |
| 30 CONTENT_SETTINGS_TYPE_MIDI_SYSEX, | 30 CONTENT_SETTINGS_TYPE_MIDI_SYSEX, |
| 31 profile, | 31 profile, |
| 32 callback), | 32 callback), |
| 33 requesting_frame_(requesting_frame) {} | 33 requesting_frame_(requesting_frame) {} |
| 34 | 34 |
| 35 MidiPermissionInfoBarDelegateAndroid::~MidiPermissionInfoBarDelegateAndroid() {} | 35 MidiPermissionInfoBarDelegateAndroid::~MidiPermissionInfoBarDelegateAndroid() {} |
| 36 | 36 |
| 37 infobars::InfoBarDelegate::InfoBarIdentifier | 37 infobars::InfoBarDelegate::InfoBarIdentifier |
| 38 MidiPermissionInfoBarDelegateAndroid::GetIdentifier() const { | 38 MidiPermissionInfoBarDelegateAndroid::GetIdentifier() const { |
| 39 return MIDI_PERMISSION_INFOBAR_DELEGATE_ANDROID; | 39 return MIDI_PERMISSION_INFOBAR_DELEGATE_ANDROID; |
| 40 } | 40 } |
| 41 | 41 |
| 42 int MidiPermissionInfoBarDelegateAndroid::GetIconId() const { | 42 int MidiPermissionInfoBarDelegateAndroid::GetIconId() const { |
| 43 return IDR_INFOBAR_MIDI; | 43 return IDR_INFOBAR_MIDI; |
| 44 } | 44 } |
| 45 | 45 |
| 46 int MidiPermissionInfoBarDelegateAndroid::GetMessageResourceId() const { | 46 int MidiPermissionInfoBarDelegateAndroid::GetMessageResourceId() const { |
| 47 return IDS_MIDI_SYSEX_INFOBAR_QUESTION; | 47 return IDS_MIDI_SYSEX_INFOBAR_QUESTION; |
| 48 } | 48 } |
| OLD | NEW |