Chromium Code Reviews| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 77 #endif | 77 #endif |
| 78 case PermissionType::DURABLE_STORAGE: | 78 case PermissionType::DURABLE_STORAGE: |
| 79 return CONTENT_SETTINGS_TYPE_DURABLE_STORAGE; | 79 return CONTENT_SETTINGS_TYPE_DURABLE_STORAGE; |
| 80 case PermissionType::MIDI: | 80 case PermissionType::MIDI: |
| 81 // This will hit the NOTREACHED below. | 81 // This will hit the NOTREACHED below. |
| 82 break; | 82 break; |
| 83 case PermissionType::AUDIO_CAPTURE: | 83 case PermissionType::AUDIO_CAPTURE: |
| 84 return CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC; | 84 return CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC; |
| 85 case PermissionType::VIDEO_CAPTURE: | 85 case PermissionType::VIDEO_CAPTURE: |
| 86 return CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA; | 86 return CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA; |
| 87 case PermissionType::BLUETOOTH_GUARD: | |
|
raymes
2016/02/22 22:34:34
I wonder if we should just call this BLUETOOTH?
Jeffrey Yasskin
2016/02/22 22:52:17
I picked BLUETOOTH_GUARD because it's not where th
| |
| 88 return CONTENT_SETTINGS_TYPE_BLUETOOTH_GUARD; | |
| 87 case PermissionType::NUM: | 89 case PermissionType::NUM: |
| 88 // This will hit the NOTREACHED below. | 90 // This will hit the NOTREACHED below. |
| 89 break; | 91 break; |
| 90 } | 92 } |
| 91 | 93 |
| 92 NOTREACHED() << "Unknown content setting for permission " | 94 NOTREACHED() << "Unknown content setting for permission " |
| 93 << static_cast<int>(permission); | 95 << static_cast<int>(permission); |
| 94 return CONTENT_SETTINGS_TYPE_DEFAULT; | 96 return CONTENT_SETTINGS_TYPE_DEFAULT; |
| 95 } | 97 } |
| 96 | 98 |
| (...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 423 // Add the callback to |callbacks| which will be run after the loop to | 425 // Add the callback to |callbacks| which will be run after the loop to |
| 424 // prevent re-entrance issues. | 426 // prevent re-entrance issues. |
| 425 callbacks.push_back( | 427 callbacks.push_back( |
| 426 base::Bind(subscription->callback, | 428 base::Bind(subscription->callback, |
| 427 ContentSettingToPermissionStatus(new_value))); | 429 ContentSettingToPermissionStatus(new_value))); |
| 428 } | 430 } |
| 429 | 431 |
| 430 for (const auto& callback : callbacks) | 432 for (const auto& callback : callbacks) |
| 431 callback.Run(); | 433 callback.Run(); |
| 432 } | 434 } |
| OLD | NEW |