| 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/permission_context_base.h" | 8 #include "chrome/browser/content_settings/permission_context_base.h" |
| 9 #include "chrome/browser/permissions/permission_context.h" | 9 #include "chrome/browser/permissions/permission_context.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::NUM: | 63 case PermissionType::NUM: |
| 62 // This will hit the NOTREACHED below. | 64 // This will hit the NOTREACHED below. |
| 63 break; | 65 break; |
| 64 } | 66 } |
| 65 | 67 |
| 66 NOTREACHED() << "Unknown content setting for permission " | 68 NOTREACHED() << "Unknown content setting for permission " |
| 67 << static_cast<int>(permission); | 69 << static_cast<int>(permission); |
| 68 return CONTENT_SETTINGS_TYPE_DEFAULT; | 70 return CONTENT_SETTINGS_TYPE_DEFAULT; |
| 69 } | 71 } |
| 70 | 72 |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 // Add the callback to |callbacks| which will be run after the loop to | 239 // Add the callback to |callbacks| which will be run after the loop to |
| 238 // prevent re-entrance issues. | 240 // prevent re-entrance issues. |
| 239 callbacks.push_back( | 241 callbacks.push_back( |
| 240 base::Bind(subscription->callback, | 242 base::Bind(subscription->callback, |
| 241 ContentSettingToPermissionStatus(new_value))); | 243 ContentSettingToPermissionStatus(new_value))); |
| 242 } | 244 } |
| 243 | 245 |
| 244 for (const auto& callback : callbacks) | 246 for (const auto& callback : callbacks) |
| 245 callback.Run(); | 247 callback.Run(); |
| 246 } | 248 } |
| OLD | NEW |