| 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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 94     case PermissionType::DURABLE_STORAGE: | 94     case PermissionType::DURABLE_STORAGE: | 
| 95       return CONTENT_SETTINGS_TYPE_DURABLE_STORAGE; | 95       return CONTENT_SETTINGS_TYPE_DURABLE_STORAGE; | 
| 96     case PermissionType::AUDIO_CAPTURE: | 96     case PermissionType::AUDIO_CAPTURE: | 
| 97       return CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC; | 97       return CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC; | 
| 98     case PermissionType::VIDEO_CAPTURE: | 98     case PermissionType::VIDEO_CAPTURE: | 
| 99       return CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA; | 99       return CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA; | 
| 100     case PermissionType::BACKGROUND_SYNC: | 100     case PermissionType::BACKGROUND_SYNC: | 
| 101       return CONTENT_SETTINGS_TYPE_BACKGROUND_SYNC; | 101       return CONTENT_SETTINGS_TYPE_BACKGROUND_SYNC; | 
| 102     case PermissionType::FLASH: | 102     case PermissionType::FLASH: | 
| 103       return CONTENT_SETTINGS_TYPE_PLUGINS; | 103       return CONTENT_SETTINGS_TYPE_PLUGINS; | 
|  | 104     // TODO(riju): Add ContentSetting entries for sensors later. | 
|  | 105     case PermissionType::AMBIENT_LIGHT_SENSOR: | 
|  | 106       return CONTENT_SETTINGS_TYPE_DEFAULT; | 
|  | 107     case PermissionType::ACCELEROMETER: | 
|  | 108       return CONTENT_SETTINGS_TYPE_DEFAULT; | 
|  | 109     case PermissionType::GYROSCOPE: | 
|  | 110       return CONTENT_SETTINGS_TYPE_DEFAULT; | 
|  | 111     case PermissionType::MAGNETOMETER: | 
|  | 112       return CONTENT_SETTINGS_TYPE_DEFAULT; | 
| 104     case PermissionType::NUM: | 113     case PermissionType::NUM: | 
| 105       // This will hit the NOTREACHED below. | 114       // This will hit the NOTREACHED below. | 
| 106       break; | 115       break; | 
| 107   } | 116   } | 
| 108 | 117 | 
| 109   NOTREACHED() << "Unknown content setting for permission " | 118   NOTREACHED() << "Unknown content setting for permission " | 
| 110                << static_cast<int>(permission); | 119                << static_cast<int>(permission); | 
| 111   return CONTENT_SETTINGS_TYPE_DEFAULT; | 120   return CONTENT_SETTINGS_TYPE_DEFAULT; | 
| 112 } | 121 } | 
| 113 | 122 | 
| (...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 548   } | 557   } | 
| 549   PermissionContextBase* context = GetPermissionContext(permission); | 558   PermissionContextBase* context = GetPermissionContext(permission); | 
| 550   PermissionResult result = context->GetPermissionStatus( | 559   PermissionResult result = context->GetPermissionStatus( | 
| 551       nullptr /* render_frame_host */, requesting_origin.GetOrigin(), | 560       nullptr /* render_frame_host */, requesting_origin.GetOrigin(), | 
| 552       embedding_origin.GetOrigin()); | 561       embedding_origin.GetOrigin()); | 
| 553   DCHECK(result.content_setting == CONTENT_SETTING_ALLOW || | 562   DCHECK(result.content_setting == CONTENT_SETTING_ALLOW || | 
| 554          result.content_setting == CONTENT_SETTING_ASK || | 563          result.content_setting == CONTENT_SETTING_ASK || | 
| 555          result.content_setting == CONTENT_SETTING_BLOCK); | 564          result.content_setting == CONTENT_SETTING_BLOCK); | 
| 556   return result; | 565   return result; | 
| 557 } | 566 } | 
| OLD | NEW | 
|---|