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_util.h" | 5 #include "chrome/browser/permissions/permission_util.h" |
6 | 6 |
7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
8 #include "base/feature_list.h" | 8 #include "base/feature_list.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" | 10 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 } | 53 } |
54 NOTREACHED(); | 54 NOTREACHED(); |
55 return std::string(); | 55 return std::string(); |
56 } | 56 } |
57 | 57 |
58 PermissionRequestType PermissionUtil::GetRequestType( | 58 PermissionRequestType PermissionUtil::GetRequestType( |
59 content::PermissionType type) { | 59 content::PermissionType type) { |
60 switch (type) { | 60 switch (type) { |
61 case content::PermissionType::GEOLOCATION: | 61 case content::PermissionType::GEOLOCATION: |
62 return PermissionRequestType::PERMISSION_GEOLOCATION; | 62 return PermissionRequestType::PERMISSION_GEOLOCATION; |
63 #if defined(ENABLE_NOTIFICATIONS) | |
64 case content::PermissionType::NOTIFICATIONS: | 63 case content::PermissionType::NOTIFICATIONS: |
65 return PermissionRequestType::PERMISSION_NOTIFICATIONS; | 64 return PermissionRequestType::PERMISSION_NOTIFICATIONS; |
66 #endif | |
67 case content::PermissionType::MIDI_SYSEX: | 65 case content::PermissionType::MIDI_SYSEX: |
68 return PermissionRequestType::PERMISSION_MIDI_SYSEX; | 66 return PermissionRequestType::PERMISSION_MIDI_SYSEX; |
69 case content::PermissionType::PUSH_MESSAGING: | 67 case content::PermissionType::PUSH_MESSAGING: |
70 return PermissionRequestType::PERMISSION_PUSH_MESSAGING; | 68 return PermissionRequestType::PERMISSION_PUSH_MESSAGING; |
71 case content::PermissionType::PROTECTED_MEDIA_IDENTIFIER: | 69 case content::PermissionType::PROTECTED_MEDIA_IDENTIFIER: |
72 return PermissionRequestType::PERMISSION_PROTECTED_MEDIA_IDENTIFIER; | 70 return PermissionRequestType::PERMISSION_PROTECTED_MEDIA_IDENTIFIER; |
73 case content::PermissionType::FLASH: | 71 case content::PermissionType::FLASH: |
74 return PermissionRequestType::PERMISSION_FLASH; | 72 return PermissionRequestType::PERMISSION_FLASH; |
75 default: | 73 default: |
76 NOTREACHED(); | 74 NOTREACHED(); |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 ContentSetting final_content_setting = settings_map->GetContentSetting( | 158 ContentSetting final_content_setting = settings_map->GetContentSetting( |
161 primary_url_, secondary_url_, content_type_, std::string()); | 159 primary_url_, secondary_url_, content_type_, std::string()); |
162 if (final_content_setting != CONTENT_SETTING_ALLOW) { | 160 if (final_content_setting != CONTENT_SETTING_ALLOW) { |
163 PermissionType permission_type; | 161 PermissionType permission_type; |
164 if (PermissionUtil::GetPermissionType(content_type_, &permission_type)) { | 162 if (PermissionUtil::GetPermissionType(content_type_, &permission_type)) { |
165 PermissionUmaUtil::PermissionRevoked(permission_type, source_ui_, | 163 PermissionUmaUtil::PermissionRevoked(permission_type, source_ui_, |
166 primary_url_, profile_); | 164 primary_url_, profile_); |
167 } | 165 } |
168 } | 166 } |
169 } | 167 } |
OLD | NEW |