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

Side by Side Diff: content/browser/permissions/permission_service_impl.cc

Issue 1311783007: refactor to Introduce AUDIO_CAPTURE and VIDEO_CAPTURE permissions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/browser/permissions/permission_service_impl.h" 5 #include "content/browser/permissions/permission_service_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "content/public/browser/browser_context.h" 8 #include "content/public/browser/browser_context.h"
9 #include "content/public/browser/permission_manager.h" 9 #include "content/public/browser/permission_manager.h"
10 #include "content/public/browser/permission_type.h" 10 #include "content/public/browser/permission_type.h"
(...skipping 11 matching lines...) Expand all
22 case PERMISSION_NAME_PUSH_NOTIFICATIONS: 22 case PERMISSION_NAME_PUSH_NOTIFICATIONS:
23 return PermissionType::PUSH_MESSAGING; 23 return PermissionType::PUSH_MESSAGING;
24 case PERMISSION_NAME_MIDI: 24 case PERMISSION_NAME_MIDI:
25 return PermissionType::MIDI; 25 return PermissionType::MIDI;
26 case PERMISSION_NAME_MIDI_SYSEX: 26 case PERMISSION_NAME_MIDI_SYSEX:
27 return PermissionType::MIDI_SYSEX; 27 return PermissionType::MIDI_SYSEX;
28 case PERMISSION_NAME_PROTECTED_MEDIA_IDENTIFIER: 28 case PERMISSION_NAME_PROTECTED_MEDIA_IDENTIFIER:
29 return PermissionType::PROTECTED_MEDIA_IDENTIFIER; 29 return PermissionType::PROTECTED_MEDIA_IDENTIFIER;
30 case PERMISSION_NAME_DURABLE_STORAGE: 30 case PERMISSION_NAME_DURABLE_STORAGE:
31 return PermissionType::DURABLE_STORAGE; 31 return PermissionType::DURABLE_STORAGE;
32 case PERMISSION_NAME_AUDIO_CAPTURE:
33 return PermissionType::AUDIO_CAPTURE;
34 case PERMISSION_NAME_VIDEO_CAPTURE:
35 return PermissionType::VIDEO_CAPTURE;
32 } 36 }
33 37
34 NOTREACHED(); 38 NOTREACHED();
palmer 2015/09/01 18:31:04 Put this in the default:.
guoweis_left_chromium 2015/09/01 19:36:34 same here.
35 return PermissionType::NUM; 39 return PermissionType::NUM;
36 } 40 }
37 41
38 } // anonymous namespace 42 } // anonymous namespace
39 43
40 PermissionServiceImpl::PendingRequest::PendingRequest( 44 PermissionServiceImpl::PendingRequest::PendingRequest(
41 PermissionType permission, 45 PermissionType permission,
42 const GURL& origin, 46 const GURL& origin,
43 const PermissionStatusCallback& callback) 47 const PermissionStatusCallback& callback)
44 : permission(permission), 48 : permission(permission),
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 289
286 PermissionStatusCallback callback = subscription->callback; 290 PermissionStatusCallback callback = subscription->callback;
287 291
288 subscription->callback.reset(); 292 subscription->callback.reset();
289 pending_subscriptions_.Remove(pending_subscription_id); 293 pending_subscriptions_.Remove(pending_subscription_id);
290 294
291 callback.Run(status); 295 callback.Run(status);
292 } 296 }
293 297
294 } // namespace content 298 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698