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 "content/renderer/media/midi_dispatcher.h" | 5 #include "content/renderer/media/midi_dispatcher.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "content/common/media/midi_messages.h" | 9 #include "content/common/media/midi_messages.h" |
10 #include "content/renderer/render_view_impl.h" | 10 #include "content/renderer/render_view_impl.h" |
11 #include "third_party/WebKit/public/web/WebMIDIPermissionRequest.h" | 11 #include "third_party/WebKit/public/web/WebMIDIPermissionRequest.h" |
12 #include "third_party/WebKit/public/web/WebSecurityOrigin.h" | 12 #include "third_party/WebKit/public/web/WebSecurityOrigin.h" |
13 | 13 |
14 using WebKit::WebMIDIPermissionRequest; | 14 using blink::WebMIDIPermissionRequest; |
15 using WebKit::WebSecurityOrigin; | 15 using blink::WebSecurityOrigin; |
16 | 16 |
17 namespace content { | 17 namespace content { |
18 | 18 |
19 MIDIDispatcher::MIDIDispatcher(RenderViewImpl* render_view) | 19 MIDIDispatcher::MIDIDispatcher(RenderViewImpl* render_view) |
20 : RenderViewObserver(render_view) { | 20 : RenderViewObserver(render_view) { |
21 } | 21 } |
22 | 22 |
23 MIDIDispatcher::~MIDIDispatcher() {} | 23 MIDIDispatcher::~MIDIDispatcher() {} |
24 | 24 |
25 bool MIDIDispatcher::OnMessageReceived(const IPC::Message& message) { | 25 bool MIDIDispatcher::OnMessageReceived(const IPC::Message& message) { |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 void MIDIDispatcher::OnSysExPermissionApproved(int bridge_id, bool is_allowed) { | 60 void MIDIDispatcher::OnSysExPermissionApproved(int bridge_id, bool is_allowed) { |
61 // |request| can be NULL when the request is canceled. | 61 // |request| can be NULL when the request is canceled. |
62 WebMIDIPermissionRequest* request = requests_.Lookup(bridge_id); | 62 WebMIDIPermissionRequest* request = requests_.Lookup(bridge_id); |
63 if (!request) | 63 if (!request) |
64 return; | 64 return; |
65 request->setIsAllowed(is_allowed); | 65 request->setIsAllowed(is_allowed); |
66 requests_.Remove(bridge_id); | 66 requests_.Remove(bridge_id); |
67 } | 67 } |
68 | 68 |
69 } // namespace content | 69 } // namespace content |
OLD | NEW |