Updating trunk VERSION from 2139.0 to 2140.0
[chromium-blink-merge.git] / chrome / browser / media / midi_permission_context.cc
blob62e767a448d31782c9d0f79a5e96d1a7a2c9f706
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
3 // found in the LICENSE file.
5 #include "chrome/browser/media/midi_permission_context.h"
7 #include "chrome/browser/content_settings/permission_request_id.h"
8 #include "chrome/browser/content_settings/tab_specific_content_settings.h"
9 #include "url/gurl.h"
11 MidiPermissionContext::MidiPermissionContext(Profile* profile)
12 : PermissionContextBase(profile, CONTENT_SETTINGS_TYPE_MIDI_SYSEX) {
15 MidiPermissionContext::~MidiPermissionContext() {
19 void MidiPermissionContext::UpdateTabContext(const PermissionRequestID& id,
20 const GURL& requesting_frame,
21 bool allowed) {
22 TabSpecificContentSettings* content_settings =
23 TabSpecificContentSettings::Get(id.render_process_id(),
24 id.render_view_id());
25 if (content_settings) {
26 if (allowed)
27 content_settings->OnMidiSysExAccessed(requesting_frame);
28 else
29 content_settings->OnMidiSysExAccessBlocked(requesting_frame);