| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_request_impl.h" | 5 #include "chrome/browser/permissions/permission_request_impl.h" |
| 6 | 6 |
| 7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 #include "chrome/browser/permissions/permission_decision_auto_blocker.h" | 8 #include "chrome/browser/permissions/permission_decision_auto_blocker.h" |
| 9 #include "chrome/browser/permissions/permission_uma_util.h" | 9 #include "chrome/browser/permissions/permission_uma_util.h" |
| 10 #include "chrome/browser/permissions/permission_util.h" | 10 #include "chrome/browser/permissions/permission_util.h" |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 NOTREACHED(); | 175 NOTREACHED(); |
| 176 return PermissionRequestType::UNKNOWN; | 176 return PermissionRequestType::UNKNOWN; |
| 177 } | 177 } |
| 178 } | 178 } |
| 179 | 179 |
| 180 PermissionRequestGestureType PermissionRequestImpl::GetGestureType() | 180 PermissionRequestGestureType PermissionRequestImpl::GetGestureType() |
| 181 const { | 181 const { |
| 182 return has_gesture_ ? PermissionRequestGestureType::GESTURE | 182 return has_gesture_ ? PermissionRequestGestureType::GESTURE |
| 183 : PermissionRequestGestureType::NO_GESTURE; | 183 : PermissionRequestGestureType::NO_GESTURE; |
| 184 } | 184 } |
| 185 |
| 186 ContentSettingsType PermissionRequestImpl::GetContentSettingsType() const { |
| 187 switch (permission_type_) { |
| 188 case content::PermissionType::GEOLOCATION: |
| 189 return CONTENT_SETTINGS_TYPE_GEOLOCATION; |
| 190 case content::PermissionType::PUSH_MESSAGING: |
| 191 #if defined(ENABLE_NOTIFICATIONS) |
| 192 case content::PermissionType::NOTIFICATIONS: |
| 193 #endif |
| 194 return CONTENT_SETTINGS_TYPE_NOTIFICATIONS; |
| 195 case content::PermissionType::MIDI_SYSEX: |
| 196 return CONTENT_SETTINGS_TYPE_MIDI_SYSEX; |
| 197 #if defined(OS_CHROMEOS) |
| 198 case content::PermissionType::PROTECTED_MEDIA_IDENTIFIER: |
| 199 return CONTENT_SETTINGS_TYPE_PROTECTED_MEDIA_IDENTIFIER; |
| 200 #endif |
| 201 case content::PermissionType::FLASH: |
| 202 return CONTENT_SETTINGS_TYPE_PLUGINS; |
| 203 default: |
| 204 NOTREACHED(); |
| 205 return CONTENT_SETTINGS_TYPE_DEFAULT; |
| 206 } |
| 207 } |
| OLD | NEW |