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 <memory> | 7 #include <memory> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 97 case PermissionType::DURABLE_STORAGE: | 97 case PermissionType::DURABLE_STORAGE: |
| 98 return CONTENT_SETTINGS_TYPE_DURABLE_STORAGE; | 98 return CONTENT_SETTINGS_TYPE_DURABLE_STORAGE; |
| 99 case PermissionType::AUDIO_CAPTURE: | 99 case PermissionType::AUDIO_CAPTURE: |
| 100 return CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC; | 100 return CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC; |
| 101 case PermissionType::VIDEO_CAPTURE: | 101 case PermissionType::VIDEO_CAPTURE: |
| 102 return CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA; | 102 return CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA; |
| 103 case PermissionType::BACKGROUND_SYNC: | 103 case PermissionType::BACKGROUND_SYNC: |
| 104 return CONTENT_SETTINGS_TYPE_BACKGROUND_SYNC; | 104 return CONTENT_SETTINGS_TYPE_BACKGROUND_SYNC; |
| 105 case PermissionType::FLASH: | 105 case PermissionType::FLASH: |
| 106 return CONTENT_SETTINGS_TYPE_PLUGINS; | 106 return CONTENT_SETTINGS_TYPE_PLUGINS; |
| 107 // TODO(riju): Add ContentSetting entries for sensors later. | |
| 108 case PermissionType::SENSORS: | |
| 109 return CONTENT_SETTINGS_TYPE_DEFAULT; | |
|
Reilly Grant (use Gerrit)
2017/07/20 13:56:01
Is it valid to use this? Maybe we should combine t
riju_
2017/07/21 13:03:38
Done.
| |
| 107 case PermissionType::NUM: | 110 case PermissionType::NUM: |
| 108 // This will hit the NOTREACHED below. | 111 // This will hit the NOTREACHED below. |
| 109 break; | 112 break; |
| 110 } | 113 } |
| 111 | 114 |
| 112 NOTREACHED() << "Unknown content setting for permission " | 115 NOTREACHED() << "Unknown content setting for permission " |
| 113 << static_cast<int>(permission); | 116 << static_cast<int>(permission); |
| 114 return CONTENT_SETTINGS_TYPE_DEFAULT; | 117 return CONTENT_SETTINGS_TYPE_DEFAULT; |
| 115 } | 118 } |
| 116 | 119 |
| (...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 576 const GURL& embedding_origin) { | 579 const GURL& embedding_origin) { |
| 577 PermissionContextBase* context = GetPermissionContext(permission); | 580 PermissionContextBase* context = GetPermissionContext(permission); |
| 578 PermissionResult result = context->GetPermissionStatus( | 581 PermissionResult result = context->GetPermissionStatus( |
| 579 render_frame_host, requesting_origin.GetOrigin(), | 582 render_frame_host, requesting_origin.GetOrigin(), |
| 580 embedding_origin.GetOrigin()); | 583 embedding_origin.GetOrigin()); |
| 581 DCHECK(result.content_setting == CONTENT_SETTING_ALLOW || | 584 DCHECK(result.content_setting == CONTENT_SETTING_ALLOW || |
| 582 result.content_setting == CONTENT_SETTING_ASK || | 585 result.content_setting == CONTENT_SETTING_ASK || |
| 583 result.content_setting == CONTENT_SETTING_BLOCK); | 586 result.content_setting == CONTENT_SETTING_BLOCK); |
| 584 return result; | 587 return result; |
| 585 } | 588 } |
| OLD | NEW |