Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_queue_controller.h" | 5 #include "chrome/browser/permissions/permission_queue_controller.h" |
| 6 | 6 |
| 7 #include "chrome/browser/chrome_notification_types.h" | 7 #include "chrome/browser/chrome_notification_types.h" |
| 8 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" | 8 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" |
| 9 #include "chrome/browser/geolocation/geolocation_infobar_delegate_android.h" | 9 #include "chrome/browser/geolocation/geolocation_infobar_delegate_android.h" |
| 10 #include "chrome/browser/infobars/infobar_service.h" | 10 #include "chrome/browser/infobars/infobar_service.h" |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 210 bool user_gesture, | 210 bool user_gesture, |
| 211 bool update_content_setting, | 211 bool update_content_setting, |
| 212 bool allowed) { | 212 bool allowed) { |
| 213 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 213 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 214 | 214 |
| 215 // TODO(miguelg): move the permission persistence to | 215 // TODO(miguelg): move the permission persistence to |
| 216 // PermissionContextBase once all the types are moved there. | 216 // PermissionContextBase once all the types are moved there. |
| 217 PermissionRequestGestureType gesture_type = | 217 PermissionRequestGestureType gesture_type = |
| 218 user_gesture ? PermissionRequestGestureType::GESTURE | 218 user_gesture ? PermissionRequestGestureType::GESTURE |
| 219 : PermissionRequestGestureType::NO_GESTURE; | 219 : PermissionRequestGestureType::NO_GESTURE; |
| 220 | |
|
raymes
2016/08/05 03:27:48
nit: remove from this CL
dominickn
2016/08/05 04:29:30
Done.
| |
| 220 if (update_content_setting) { | 221 if (update_content_setting) { |
| 221 UpdateContentSetting(requesting_frame, embedder, allowed); | 222 UpdateContentSetting(requesting_frame, embedder, allowed); |
| 222 if (allowed) { | 223 if (allowed) { |
| 223 PermissionUmaUtil::PermissionGranted(permission_type_, gesture_type, | 224 PermissionUmaUtil::PermissionGranted(permission_type_, gesture_type, |
| 224 requesting_frame, profile_); | 225 requesting_frame, profile_); |
| 225 } else { | 226 } else { |
| 226 PermissionUmaUtil::PermissionDenied(permission_type_, gesture_type, | 227 PermissionUmaUtil::PermissionDenied(permission_type_, gesture_type, |
| 227 requesting_frame, profile_); | 228 requesting_frame, profile_); |
| 228 } | 229 } |
| 229 } else { | 230 } else { |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 401 } | 402 } |
| 402 | 403 |
| 403 ContentSetting content_setting = | 404 ContentSetting content_setting = |
| 404 allowed ? CONTENT_SETTING_ALLOW : CONTENT_SETTING_BLOCK; | 405 allowed ? CONTENT_SETTING_ALLOW : CONTENT_SETTING_BLOCK; |
| 405 | 406 |
| 406 HostContentSettingsMapFactory::GetForProfile(profile_) | 407 HostContentSettingsMapFactory::GetForProfile(profile_) |
| 407 ->SetContentSettingDefaultScope( | 408 ->SetContentSettingDefaultScope( |
| 408 requesting_frame.GetOrigin(), embedder.GetOrigin(), | 409 requesting_frame.GetOrigin(), embedder.GetOrigin(), |
| 409 content_settings_type_, std::string(), content_setting); | 410 content_settings_type_, std::string(), content_setting); |
| 410 } | 411 } |
| OLD | NEW |