OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/permissions/permission_manager.h" | 5 #include "chrome/browser/permissions/permission_manager.h" |
6 | 6 |
7 #include "base/callback.h" | 7 #include "base/callback.h" |
8 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" | 8 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" |
9 #include "chrome/browser/permissions/permission_context.h" | 9 #include "chrome/browser/permissions/permission_context.h" |
10 #include "chrome/browser/permissions/permission_context_base.h" | 10 #include "chrome/browser/permissions/permission_context_base.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 #endif | 66 #endif |
67 case PermissionType::DURABLE_STORAGE: | 67 case PermissionType::DURABLE_STORAGE: |
68 return CONTENT_SETTINGS_TYPE_DURABLE_STORAGE; | 68 return CONTENT_SETTINGS_TYPE_DURABLE_STORAGE; |
69 case PermissionType::MIDI: | 69 case PermissionType::MIDI: |
70 // This will hit the NOTREACHED below. | 70 // This will hit the NOTREACHED below. |
71 break; | 71 break; |
72 case PermissionType::AUDIO_CAPTURE: | 72 case PermissionType::AUDIO_CAPTURE: |
73 return CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC; | 73 return CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC; |
74 case PermissionType::VIDEO_CAPTURE: | 74 case PermissionType::VIDEO_CAPTURE: |
75 return CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA; | 75 return CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA; |
| 76 case PermissionType::USB: |
| 77 return CONTENT_SETTINGS_TYPE_USB; |
76 case PermissionType::NUM: | 78 case PermissionType::NUM: |
77 // This will hit the NOTREACHED below. | 79 // This will hit the NOTREACHED below. |
78 break; | 80 break; |
79 } | 81 } |
80 | 82 |
81 NOTREACHED() << "Unknown content setting for permission " | 83 NOTREACHED() << "Unknown content setting for permission " |
82 << static_cast<int>(permission); | 84 << static_cast<int>(permission); |
83 return CONTENT_SETTINGS_TYPE_DEFAULT; | 85 return CONTENT_SETTINGS_TYPE_DEFAULT; |
84 } | 86 } |
85 | 87 |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
341 // Add the callback to |callbacks| which will be run after the loop to | 343 // Add the callback to |callbacks| which will be run after the loop to |
342 // prevent re-entrance issues. | 344 // prevent re-entrance issues. |
343 callbacks.push_back( | 345 callbacks.push_back( |
344 base::Bind(subscription->callback, | 346 base::Bind(subscription->callback, |
345 ContentSettingToPermissionStatus(new_value))); | 347 ContentSettingToPermissionStatus(new_value))); |
346 } | 348 } |
347 | 349 |
348 for (const auto& callback : callbacks) | 350 for (const auto& callback : callbacks) |
349 callback.Run(); | 351 callback.Run(); |
350 } | 352 } |
OLD | NEW |