| 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_infobar_delegate.h" | 5 #include "chrome/browser/permissions/permission_infobar_delegate.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
| 10 #include "chrome/browser/geolocation/geolocation_infobar_delegate_android.h" | 10 #include "chrome/browser/geolocation/geolocation_infobar_delegate_android.h" |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 } | 71 } |
| 72 } | 72 } |
| 73 | 73 |
| 74 PermissionInfoBarDelegate::~PermissionInfoBarDelegate() { | 74 PermissionInfoBarDelegate::~PermissionInfoBarDelegate() { |
| 75 if (!action_taken_) { | 75 if (!action_taken_) { |
| 76 PermissionUmaUtil::PermissionIgnored( | 76 PermissionUmaUtil::PermissionIgnored( |
| 77 content_settings_type_, | 77 content_settings_type_, |
| 78 user_gesture_ ? PermissionRequestGestureType::GESTURE | 78 user_gesture_ ? PermissionRequestGestureType::GESTURE |
| 79 : PermissionRequestGestureType::NO_GESTURE, | 79 : PermissionRequestGestureType::NO_GESTURE, |
| 80 requesting_origin_, profile_); | 80 requesting_origin_, profile_); |
| 81 |
| 82 PermissionUmaUtil::RecordEmbargoStatus( |
| 83 PermissionEmbargoStatus::NOT_EMBARGOED); |
| 81 } | 84 } |
| 82 } | 85 } |
| 83 | 86 |
| 84 std::vector<int> PermissionInfoBarDelegate::content_settings_types() const { | 87 std::vector<int> PermissionInfoBarDelegate::content_settings_types() const { |
| 85 return std::vector<int>{content_settings_type_}; | 88 return std::vector<int>{content_settings_type_}; |
| 86 } | 89 } |
| 87 | 90 |
| 88 bool PermissionInfoBarDelegate::ShouldShowPersistenceToggle() const { | 91 bool PermissionInfoBarDelegate::ShouldShowPersistenceToggle() const { |
| 89 return (content_settings_type_ == CONTENT_SETTINGS_TYPE_GEOLOCATION || | 92 return (content_settings_type_ == CONTENT_SETTINGS_TYPE_GEOLOCATION || |
| 90 content_settings_type_ == CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC || | 93 content_settings_type_ == CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC || |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 PermissionInfoBarDelegate* | 159 PermissionInfoBarDelegate* |
| 157 PermissionInfoBarDelegate::AsPermissionInfoBarDelegate() { | 160 PermissionInfoBarDelegate::AsPermissionInfoBarDelegate() { |
| 158 return this; | 161 return this; |
| 159 } | 162 } |
| 160 | 163 |
| 161 void PermissionInfoBarDelegate::SetPermission(bool update_content_setting, | 164 void PermissionInfoBarDelegate::SetPermission(bool update_content_setting, |
| 162 PermissionAction decision) { | 165 PermissionAction decision) { |
| 163 action_taken_ = true; | 166 action_taken_ = true; |
| 164 callback_.Run(update_content_setting, decision); | 167 callback_.Run(update_content_setting, decision); |
| 165 } | 168 } |
| OLD | NEW |