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