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_context_base.h" | 5 #include "chrome/browser/permissions/permission_context_base.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 bool persist, | 208 bool persist, |
209 ContentSetting content_setting) { | 209 ContentSetting content_setting) { |
210 #if !defined(OS_ANDROID) | 210 #if !defined(OS_ANDROID) |
211 // Infobar persistence and its related UMA is tracked on the infobar | 211 // Infobar persistence and its related UMA is tracked on the infobar |
212 // controller directly. | 212 // controller directly. |
213 if (persist) { | 213 if (persist) { |
214 DCHECK(content_setting == CONTENT_SETTING_ALLOW || | 214 DCHECK(content_setting == CONTENT_SETTING_ALLOW || |
215 content_setting == CONTENT_SETTING_BLOCK); | 215 content_setting == CONTENT_SETTING_BLOCK); |
216 if (content_setting == CONTENT_SETTING_ALLOW) | 216 if (content_setting == CONTENT_SETTING_ALLOW) |
217 PermissionUmaUtil::PermissionGranted(permission_type_, requesting_origin, | 217 PermissionUmaUtil::PermissionGranted(permission_type_, requesting_origin, |
218 profile_); | 218 PROMPT, profile_); |
219 else | 219 else |
220 PermissionUmaUtil::PermissionDenied(permission_type_, requesting_origin, | 220 PermissionUmaUtil::PermissionDenied(permission_type_, requesting_origin, |
221 profile_); | 221 PROMPT, profile_); |
222 } else { | 222 } else { |
223 DCHECK_EQ(content_setting, CONTENT_SETTING_DEFAULT); | 223 DCHECK_EQ(content_setting, CONTENT_SETTING_DEFAULT); |
224 PermissionUmaUtil::PermissionDismissed(permission_type_, requesting_origin, | 224 PermissionUmaUtil::PermissionDismissed(permission_type_, requesting_origin, |
225 profile_); | 225 PROMPT, profile_); |
226 } | 226 } |
227 #endif | 227 #endif |
228 | 228 |
229 NotifyPermissionSet(id, requesting_origin, embedding_origin, callback, | 229 NotifyPermissionSet(id, requesting_origin, embedding_origin, callback, |
230 persist, content_setting); | 230 persist, content_setting); |
231 } | 231 } |
232 | 232 |
233 #if defined(OS_ANDROID) | 233 #if defined(OS_ANDROID) |
234 PermissionQueueController* PermissionContextBase::GetQueueController() { | 234 PermissionQueueController* PermissionContextBase::GetQueueController() { |
235 return permission_queue_controller_.get(); | 235 return permission_queue_controller_.get(); |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 content_setting); | 285 content_setting); |
286 } | 286 } |
287 | 287 |
288 bool PermissionContextBase::IsPermissionKillSwitchOn() const { | 288 bool PermissionContextBase::IsPermissionKillSwitchOn() const { |
289 const std::string param = variations::GetVariationParamValue( | 289 const std::string param = variations::GetVariationParamValue( |
290 kPermissionsKillSwitchFieldStudy, | 290 kPermissionsKillSwitchFieldStudy, |
291 PermissionUtil::GetPermissionString(permission_type_)); | 291 PermissionUtil::GetPermissionString(permission_type_)); |
292 | 292 |
293 return param == kPermissionsKillSwitchBlockedValue; | 293 return param == kPermissionsKillSwitchBlockedValue; |
294 } | 294 } |
OLD | NEW |