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

Side by Side Diff: chrome/browser/permissions/permission_queue_controller.cc

Issue 2145373002: Revert of Add hooks to permission layer for permission action reporting (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@permission-reporter-implementation
Patch Set: 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 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 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 const GURL& embedder, 198 const GURL& embedder,
199 bool update_content_setting, 199 bool update_content_setting,
200 bool allowed) { 200 bool allowed) {
201 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); 201 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
202 202
203 // TODO(miguelg): move the permission persistence to 203 // TODO(miguelg): move the permission persistence to
204 // PermissionContextBase once all the types are moved there. 204 // PermissionContextBase once all the types are moved there.
205 if (update_content_setting) { 205 if (update_content_setting) {
206 UpdateContentSetting(requesting_frame, embedder, allowed); 206 UpdateContentSetting(requesting_frame, embedder, allowed);
207 if (allowed) 207 if (allowed)
208 PermissionUmaUtil::PermissionGranted(permission_type_, requesting_frame, 208 PermissionUmaUtil::PermissionGranted(permission_type_, requesting_frame);
209 profile_);
210 else 209 else
211 PermissionUmaUtil::PermissionDenied(permission_type_, requesting_frame, 210 PermissionUmaUtil::PermissionDenied(permission_type_, requesting_frame);
212 profile_);
213 } else { 211 } else {
214 PermissionUmaUtil::PermissionDismissed(permission_type_, requesting_frame, 212 PermissionUmaUtil::PermissionDismissed(permission_type_, requesting_frame);
215 profile_);
216 } 213 }
217 214
218 // Cancel this request first, then notify listeners. TODO(pkasting): Why 215 // Cancel this request first, then notify listeners. TODO(pkasting): Why
219 // is this order important? 216 // is this order important?
220 PendingInfobarRequests requests_to_notify; 217 PendingInfobarRequests requests_to_notify;
221 PendingInfobarRequests infobars_to_remove; 218 PendingInfobarRequests infobars_to_remove;
222 std::vector<PendingInfobarRequests::iterator> pending_requests_to_remove; 219 std::vector<PendingInfobarRequests::iterator> pending_requests_to_remove;
223 for (PendingInfobarRequests::iterator i = pending_infobar_requests_.begin(); 220 for (PendingInfobarRequests::iterator i = pending_infobar_requests_.begin();
224 i != pending_infobar_requests_.end(); ++i) { 221 i != pending_infobar_requests_.end(); ++i) {
225 if (!i->IsForPair(requesting_frame, embedder)) 222 if (!i->IsForPair(requesting_frame, embedder))
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 } 382 }
386 383
387 ContentSetting content_setting = 384 ContentSetting content_setting =
388 allowed ? CONTENT_SETTING_ALLOW : CONTENT_SETTING_BLOCK; 385 allowed ? CONTENT_SETTING_ALLOW : CONTENT_SETTING_BLOCK;
389 386
390 HostContentSettingsMapFactory::GetForProfile(profile_) 387 HostContentSettingsMapFactory::GetForProfile(profile_)
391 ->SetContentSettingDefaultScope( 388 ->SetContentSettingDefaultScope(
392 requesting_frame.GetOrigin(), embedder.GetOrigin(), 389 requesting_frame.GetOrigin(), embedder.GetOrigin(),
393 content_settings_type_, std::string(), content_setting); 390 content_settings_type_, std::string(), content_setting);
394 } 391 }
OLDNEW
« no previous file with comments | « chrome/browser/permissions/permission_infobar_delegate.cc ('k') | chrome/browser/permissions/permission_uma_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698