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/permissions/permission_context.h" | 8 #include "chrome/browser/permissions/permission_context.h" |
9 #include "chrome/browser/permissions/permission_context_base.h" | 9 #include "chrome/browser/permissions/permission_context_base.h" |
10 #include "chrome/browser/permissions/permission_request_id.h" | 10 #include "chrome/browser/permissions/permission_request_id.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 return CONTENT_SETTINGS_TYPE_NOTIFICATIONS; | 51 return CONTENT_SETTINGS_TYPE_NOTIFICATIONS; |
52 case PermissionType::GEOLOCATION: | 52 case PermissionType::GEOLOCATION: |
53 return CONTENT_SETTINGS_TYPE_GEOLOCATION; | 53 return CONTENT_SETTINGS_TYPE_GEOLOCATION; |
54 case PermissionType::PROTECTED_MEDIA_IDENTIFIER: | 54 case PermissionType::PROTECTED_MEDIA_IDENTIFIER: |
55 #if defined(OS_ANDROID) || defined(OS_CHROMEOS) | 55 #if defined(OS_ANDROID) || defined(OS_CHROMEOS) |
56 return CONTENT_SETTINGS_TYPE_PROTECTED_MEDIA_IDENTIFIER; | 56 return CONTENT_SETTINGS_TYPE_PROTECTED_MEDIA_IDENTIFIER; |
57 #else | 57 #else |
58 NOTIMPLEMENTED(); | 58 NOTIMPLEMENTED(); |
59 break; | 59 break; |
60 #endif | 60 #endif |
| 61 case PermissionType::DURABLE_STORAGE: |
| 62 return CONTENT_SETTINGS_TYPE_DURABLE_STORAGE; |
61 case PermissionType::MIDI: | 63 case PermissionType::MIDI: |
62 // This will hit the NOTREACHED below. | 64 // This will hit the NOTREACHED below. |
63 break; | 65 break; |
64 case PermissionType::NUM: | 66 case PermissionType::NUM: |
65 // This will hit the NOTREACHED below. | 67 // This will hit the NOTREACHED below. |
66 break; | 68 break; |
67 } | 69 } |
68 | 70 |
69 NOTREACHED() << "Unknown content setting for permission " | 71 NOTREACHED() << "Unknown content setting for permission " |
70 << static_cast<int>(permission); | 72 << static_cast<int>(permission); |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 // Add the callback to |callbacks| which will be run after the loop to | 294 // Add the callback to |callbacks| which will be run after the loop to |
293 // prevent re-entrance issues. | 295 // prevent re-entrance issues. |
294 callbacks.push_back( | 296 callbacks.push_back( |
295 base::Bind(subscription->callback, | 297 base::Bind(subscription->callback, |
296 ContentSettingToPermissionStatus(new_value))); | 298 ContentSettingToPermissionStatus(new_value))); |
297 } | 299 } |
298 | 300 |
299 for (const auto& callback : callbacks) | 301 for (const auto& callback : callbacks) |
300 callback.Run(); | 302 callback.Run(); |
301 } | 303 } |
OLD | NEW |