| 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 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 // We are going to show a prompt now. | 182 // We are going to show a prompt now. |
| 183 PermissionUmaUtil::PermissionRequested( | 183 PermissionUmaUtil::PermissionRequested( |
| 184 content_settings_type_, requesting_origin, embedding_origin, profile_); | 184 content_settings_type_, requesting_origin, embedding_origin, profile_); |
| 185 PermissionUmaUtil::RecordEmbargoPromptSuppression( | 185 PermissionUmaUtil::RecordEmbargoPromptSuppression( |
| 186 PermissionEmbargoStatus::NOT_EMBARGOED); | 186 PermissionEmbargoStatus::NOT_EMBARGOED); |
| 187 | 187 |
| 188 DecidePermission(web_contents, id, requesting_origin, embedding_origin, | 188 DecidePermission(web_contents, id, requesting_origin, embedding_origin, |
| 189 user_gesture, callback); | 189 user_gesture, callback); |
| 190 } | 190 } |
| 191 | 191 |
| 192 void PermissionContextBase::UserMadePermissionDecision( |
| 193 const PermissionRequestID& id, |
| 194 const GURL& requesting_origin, |
| 195 const GURL& embedding_origin, |
| 196 ContentSetting content_setting) {} |
| 197 |
| 192 PermissionResult PermissionContextBase::GetPermissionStatus( | 198 PermissionResult PermissionContextBase::GetPermissionStatus( |
| 193 content::RenderFrameHost* render_frame_host, | 199 content::RenderFrameHost* render_frame_host, |
| 194 const GURL& requesting_origin, | 200 const GURL& requesting_origin, |
| 195 const GURL& embedding_origin) const { | 201 const GURL& embedding_origin) const { |
| 196 // If the permission has been disabled through Finch, block all requests. | 202 // If the permission has been disabled through Finch, block all requests. |
| 197 if (IsPermissionKillSwitchOn()) { | 203 if (IsPermissionKillSwitchOn()) { |
| 198 return PermissionResult(CONTENT_SETTING_BLOCK, | 204 return PermissionResult(CONTENT_SETTING_BLOCK, |
| 199 PermissionStatusSource::KILL_SWITCH); | 205 PermissionStatusSource::KILL_SWITCH); |
| 200 } | 206 } |
| 201 | 207 |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 352 | 358 |
| 353 if (PermissionDecisionAutoBlocker::GetForProfile(profile_) | 359 if (PermissionDecisionAutoBlocker::GetForProfile(profile_) |
| 354 ->RecordDismissAndEmbargo(requesting_origin, | 360 ->RecordDismissAndEmbargo(requesting_origin, |
| 355 content_settings_type_)) { | 361 content_settings_type_)) { |
| 356 embargo_status = PermissionEmbargoStatus::REPEATED_DISMISSALS; | 362 embargo_status = PermissionEmbargoStatus::REPEATED_DISMISSALS; |
| 357 } | 363 } |
| 358 } | 364 } |
| 359 PermissionUmaUtil::RecordEmbargoStatus(embargo_status); | 365 PermissionUmaUtil::RecordEmbargoStatus(embargo_status); |
| 360 } | 366 } |
| 361 | 367 |
| 368 UserMadePermissionDecision(id, requesting_origin, embedding_origin, |
| 369 content_setting); |
| 362 NotifyPermissionSet(id, requesting_origin, embedding_origin, callback, | 370 NotifyPermissionSet(id, requesting_origin, embedding_origin, callback, |
| 363 persist, content_setting); | 371 persist, content_setting); |
| 364 } | 372 } |
| 365 | 373 |
| 366 #if defined(OS_ANDROID) | 374 #if defined(OS_ANDROID) |
| 367 PermissionQueueController* PermissionContextBase::GetQueueController() { | 375 PermissionQueueController* PermissionContextBase::GetQueueController() { |
| 368 return permission_queue_controller_.get(); | 376 return permission_queue_controller_.get(); |
| 369 } | 377 } |
| 370 #endif | 378 #endif |
| 371 | 379 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 415 content_settings_storage_type(), | 423 content_settings_storage_type(), |
| 416 std::string(), content_setting); | 424 std::string(), content_setting); |
| 417 } | 425 } |
| 418 | 426 |
| 419 ContentSettingsType PermissionContextBase::content_settings_storage_type() | 427 ContentSettingsType PermissionContextBase::content_settings_storage_type() |
| 420 const { | 428 const { |
| 421 if (content_settings_type_ == CONTENT_SETTINGS_TYPE_PUSH_MESSAGING) | 429 if (content_settings_type_ == CONTENT_SETTINGS_TYPE_PUSH_MESSAGING) |
| 422 return CONTENT_SETTINGS_TYPE_NOTIFICATIONS; | 430 return CONTENT_SETTINGS_TYPE_NOTIFICATIONS; |
| 423 return content_settings_type_; | 431 return content_settings_type_; |
| 424 } | 432 } |
| OLD | NEW |