| 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_uma_util.h" | 8 #include "chrome/browser/permissions/permission_uma_util.h" |
| 9 #include "chrome/browser/permissions/permission_util.h" | 9 #include "chrome/browser/permissions/permission_util.h" |
| 10 #include "chrome/grit/generated_resources.h" | 10 #include "chrome/grit/generated_resources.h" |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 NOTREACHED(); | 143 NOTREACHED(); |
| 144 return PermissionRequestType::UNKNOWN; | 144 return PermissionRequestType::UNKNOWN; |
| 145 } | 145 } |
| 146 } | 146 } |
| 147 | 147 |
| 148 PermissionRequestGestureType PermissionRequestImpl::GetGestureType() | 148 PermissionRequestGestureType PermissionRequestImpl::GetGestureType() |
| 149 const { | 149 const { |
| 150 return has_gesture_ ? PermissionRequestGestureType::GESTURE | 150 return has_gesture_ ? PermissionRequestGestureType::GESTURE |
| 151 : PermissionRequestGestureType::NO_GESTURE; | 151 : PermissionRequestGestureType::NO_GESTURE; |
| 152 } | 152 } |
| 153 |
| 154 ContentSettingsType PermissionRequestImpl::GetContentSettingsType() const { |
| 155 switch (permission_type_) { |
| 156 case content::PermissionType::GEOLOCATION: |
| 157 return CONTENT_SETTINGS_TYPE_GEOLOCATION; |
| 158 case content::PermissionType::PUSH_MESSAGING: |
| 159 #if defined(ENABLE_NOTIFICATIONS) |
| 160 case content::PermissionType::NOTIFICATIONS: |
| 161 #endif |
| 162 return CONTENT_SETTINGS_TYPE_NOTIFICATIONS; |
| 163 case content::PermissionType::MIDI_SYSEX: |
| 164 return CONTENT_SETTINGS_TYPE_MIDI_SYSEX; |
| 165 #if defined(OS_CHROMEOS) |
| 166 case content::PermissionType::PROTECTED_MEDIA_IDENTIFIER: |
| 167 return CONTENT_SETTINGS_TYPE_PROTECTED_MEDIA_IDENTIFIER; |
| 168 #endif |
| 169 case content::PermissionType::FLASH: |
| 170 return CONTENT_SETTINGS_TYPE_PLUGINS; |
| 171 default: |
| 172 NOTREACHED(); |
| 173 return CONTENT_SETTINGS_TYPE_DEFAULT; |
| 174 } |
| 175 } |
| OLD | NEW |