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

Side by Side Diff: chrome/browser/media/midi_permission_infobar_delegate_android.cc

Issue 1520543004: Add method for identifying different InfoBars (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nit again Created 4 years, 11 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 unified diff | Download patch
OLDNEW
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 "components/url_formatter/elide_url.h" 10 #include "components/url_formatter/elide_url.h"
(...skipping 18 matching lines...) Expand all
29 const PermissionSetCallback& callback) 29 const PermissionSetCallback& callback)
30 : PermissionInfobarDelegate(requesting_frame, 30 : PermissionInfobarDelegate(requesting_frame,
31 content::PermissionType::MIDI_SYSEX, 31 content::PermissionType::MIDI_SYSEX,
32 CONTENT_SETTINGS_TYPE_MIDI_SYSEX, 32 CONTENT_SETTINGS_TYPE_MIDI_SYSEX,
33 callback), 33 callback),
34 requesting_frame_(requesting_frame), 34 requesting_frame_(requesting_frame),
35 display_languages_(display_languages) {} 35 display_languages_(display_languages) {}
36 36
37 MidiPermissionInfoBarDelegateAndroid::~MidiPermissionInfoBarDelegateAndroid() {} 37 MidiPermissionInfoBarDelegateAndroid::~MidiPermissionInfoBarDelegateAndroid() {}
38 38
39 infobars::InfoBarDelegate::InfoBarIdentifier
40 MidiPermissionInfoBarDelegateAndroid::GetIdentifier() const {
41 return MIDI_PERMISSION_INFOBAR_DELEGATE_ANDROID;
42 }
43
39 int MidiPermissionInfoBarDelegateAndroid::GetIconId() const { 44 int MidiPermissionInfoBarDelegateAndroid::GetIconId() const {
40 return IDR_INFOBAR_MIDI; 45 return IDR_INFOBAR_MIDI;
41 } 46 }
42 47
43 base::string16 MidiPermissionInfoBarDelegateAndroid::GetMessageText() const { 48 base::string16 MidiPermissionInfoBarDelegateAndroid::GetMessageText() const {
44 return l10n_util::GetStringFUTF16( 49 return l10n_util::GetStringFUTF16(
45 IDS_MIDI_SYSEX_INFOBAR_QUESTION, 50 IDS_MIDI_SYSEX_INFOBAR_QUESTION,
46 url_formatter::FormatUrlForSecurityDisplay(requesting_frame_.GetOrigin(), 51 url_formatter::FormatUrlForSecurityDisplay(requesting_frame_.GetOrigin(),
47 display_languages_)); 52 display_languages_));
48 } 53 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698