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

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

Issue 591443002: Componentize permission_request_id.* (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years, 2 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_context.h" 5 #include "chrome/browser/media/midi_permission_context.h"
6 6
7 #include "chrome/browser/content_settings/permission_request_id.h"
8 #include "chrome/browser/content_settings/tab_specific_content_settings.h" 7 #include "chrome/browser/content_settings/tab_specific_content_settings.h"
8 #include "components/content_settings/core/common/permission_request_id.h"
9 #include "url/gurl.h" 9 #include "url/gurl.h"
10 10
11 MidiPermissionContext::MidiPermissionContext(Profile* profile) 11 MidiPermissionContext::MidiPermissionContext(Profile* profile)
12 : PermissionContextBase(profile, CONTENT_SETTINGS_TYPE_MIDI_SYSEX) { 12 : PermissionContextBase(profile, CONTENT_SETTINGS_TYPE_MIDI_SYSEX) {
13 } 13 }
14 14
15 MidiPermissionContext::~MidiPermissionContext() { 15 MidiPermissionContext::~MidiPermissionContext() {
16 } 16 }
17 17
18 18
19 void MidiPermissionContext::UpdateTabContext(const PermissionRequestID& id, 19 void MidiPermissionContext::UpdateTabContext(const PermissionRequestID& id,
20 const GURL& requesting_frame, 20 const GURL& requesting_frame,
21 bool allowed) { 21 bool allowed) {
22 TabSpecificContentSettings* content_settings = 22 TabSpecificContentSettings* content_settings =
23 TabSpecificContentSettings::Get(id.render_process_id(), 23 TabSpecificContentSettings::Get(id.render_process_id(),
24 id.render_view_id()); 24 id.render_view_id());
25 if (content_settings) { 25 if (content_settings) {
26 if (allowed) 26 if (allowed)
27 content_settings->OnMidiSysExAccessed(requesting_frame); 27 content_settings->OnMidiSysExAccessed(requesting_frame);
28 else 28 else
29 content_settings->OnMidiSysExAccessBlocked(requesting_frame); 29 content_settings->OnMidiSysExAccessBlocked(requesting_frame);
30 } 30 }
31 } 31 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698