Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(372)

Side by Side Diff: chrome/browser/push_messaging/push_messaging_permission_context.cc

Issue 2075523002: Add SourceUI field to permission report (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add comment + TODO Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/push_messaging/push_messaging_permission_context.h" 5 #include "chrome/browser/push_messaging/push_messaging_permission_context.h"
6 6
7 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" 7 #include "chrome/browser/content_settings/host_content_settings_map_factory.h"
8 #include "chrome/browser/permissions/permission_manager.h" 8 #include "chrome/browser/permissions/permission_manager.h"
9 #include "chrome/browser/permissions/permission_request_id.h" 9 #include "chrome/browser/permissions/permission_request_id.h"
10 #include "chrome/browser/permissions/permission_uma_util.h" 10 #include "chrome/browser/permissions/permission_uma_util.h"
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 112
113 ContentSetting push_content_setting = 113 ContentSetting push_content_setting =
114 HostContentSettingsMapFactory::GetForProfile(profile_) 114 HostContentSettingsMapFactory::GetForProfile(profile_)
115 ->GetContentSettingAndMaybeUpdateLastUsage( 115 ->GetContentSettingAndMaybeUpdateLastUsage(
116 requesting_origin, embedding_origin, content_settings_type(), 116 requesting_origin, embedding_origin, content_settings_type(),
117 std::string()); 117 std::string());
118 118
119 if (push_content_setting == CONTENT_SETTING_BLOCK) { 119 if (push_content_setting == CONTENT_SETTING_BLOCK) {
120 DVLOG(1) << "Push permission was explicitly blocked."; 120 DVLOG(1) << "Push permission was explicitly blocked.";
121 PermissionUmaUtil::PermissionDenied(permission_type(), requesting_origin, 121 PermissionUmaUtil::PermissionDenied(permission_type(), requesting_origin,
122 profile_); 122 PROMPT, profile_);
123 NotifyPermissionSet(id, requesting_origin, embedding_origin, callback, 123 NotifyPermissionSet(id, requesting_origin, embedding_origin, callback,
124 true /* persist */, CONTENT_SETTING_BLOCK); 124 true /* persist */, CONTENT_SETTING_BLOCK);
125 return; 125 return;
126 } 126 }
127 127
128 if (notification_status == blink::mojom::PermissionStatus::DENIED) { 128 if (notification_status == blink::mojom::PermissionStatus::DENIED) {
129 DVLOG(1) << "Notification permission has not been granted."; 129 DVLOG(1) << "Notification permission has not been granted.";
130 NotifyPermissionSet(id, requesting_origin, embedding_origin, callback, 130 NotifyPermissionSet(id, requesting_origin, embedding_origin, callback,
131 false /* persist */, CONTENT_SETTING_BLOCK); 131 false /* persist */, CONTENT_SETTING_BLOCK);
132 return; 132 return;
133 } 133 }
134 134
135 PermissionUmaUtil::PermissionGranted(permission_type(), requesting_origin, 135 PermissionUmaUtil::PermissionGranted(permission_type(), requesting_origin,
136 profile_); 136 PROMPT, profile_);
137 NotifyPermissionSet(id, requesting_origin, embedding_origin, callback, 137 NotifyPermissionSet(id, requesting_origin, embedding_origin, callback,
138 true /* persist */, CONTENT_SETTING_ALLOW); 138 true /* persist */, CONTENT_SETTING_ALLOW);
139 } 139 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698