| 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 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 } | 282 } |
| 283 | 283 |
| 284 void PermissionContextBase::PermissionDecided( | 284 void PermissionContextBase::PermissionDecided( |
| 285 const PermissionRequestID& id, | 285 const PermissionRequestID& id, |
| 286 const GURL& requesting_origin, | 286 const GURL& requesting_origin, |
| 287 const GURL& embedding_origin, | 287 const GURL& embedding_origin, |
| 288 bool user_gesture, | 288 bool user_gesture, |
| 289 const BrowserPermissionCallback& callback, | 289 const BrowserPermissionCallback& callback, |
| 290 bool persist, | 290 bool persist, |
| 291 ContentSetting content_setting) { | 291 ContentSetting content_setting) { |
| 292 PermissionUmaUtil::RecordPermissionEmbargoReason( |
| 293 PermissionEmbargoReason::NOT_EMBARGOED); |
| 292 if (PermissionRequestManager::IsEnabled()) { | 294 if (PermissionRequestManager::IsEnabled()) { |
| 293 // Infobar persistence and its related UMA is tracked on the infobar | 295 // Infobar persistence and its related UMA is tracked on the infobar |
| 294 // controller directly. | 296 // controller directly. |
| 295 PermissionRequestGestureType gesture_type = | 297 PermissionRequestGestureType gesture_type = |
| 296 user_gesture ? PermissionRequestGestureType::GESTURE | 298 user_gesture ? PermissionRequestGestureType::GESTURE |
| 297 : PermissionRequestGestureType::NO_GESTURE; | 299 : PermissionRequestGestureType::NO_GESTURE; |
| 298 DCHECK(content_setting == CONTENT_SETTING_ALLOW || | 300 DCHECK(content_setting == CONTENT_SETTING_ALLOW || |
| 299 content_setting == CONTENT_SETTING_BLOCK || | 301 content_setting == CONTENT_SETTING_BLOCK || |
| 300 content_setting == CONTENT_SETTING_DEFAULT); | 302 content_setting == CONTENT_SETTING_DEFAULT); |
| 301 if (content_setting == CONTENT_SETTING_ALLOW) { | 303 if (content_setting == CONTENT_SETTING_ALLOW) { |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 367 DCHECK(content_setting == CONTENT_SETTING_ALLOW || | 369 DCHECK(content_setting == CONTENT_SETTING_ALLOW || |
| 368 content_setting == CONTENT_SETTING_BLOCK); | 370 content_setting == CONTENT_SETTING_BLOCK); |
| 369 DCHECK(!requesting_origin.SchemeIsFile()); | 371 DCHECK(!requesting_origin.SchemeIsFile()); |
| 370 DCHECK(!embedding_origin.SchemeIsFile()); | 372 DCHECK(!embedding_origin.SchemeIsFile()); |
| 371 | 373 |
| 372 HostContentSettingsMapFactory::GetForProfile(profile_) | 374 HostContentSettingsMapFactory::GetForProfile(profile_) |
| 373 ->SetContentSettingDefaultScope(requesting_origin, embedding_origin, | 375 ->SetContentSettingDefaultScope(requesting_origin, embedding_origin, |
| 374 content_settings_type_, std::string(), | 376 content_settings_type_, std::string(), |
| 375 content_setting); | 377 content_setting); |
| 376 } | 378 } |
| OLD | NEW |