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

Side by Side Diff: chrome/browser/content_settings/permission_context_base.cc

Issue 1130253010: Fix UMA reporting for permission granted stats with bubbles (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/content_settings/permission_context_base.h" 5 #include "chrome/browser/content_settings/permission_context_base.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/prefs/pref_service.h" 8 #include "base/prefs/pref_service.h"
9 #include "chrome/browser/content_settings/permission_bubble_request_impl.h" 9 #include "chrome/browser/content_settings/permission_bubble_request_impl.h"
10 #include "chrome/browser/content_settings/permission_context_uma_util.h" 10 #include "chrome/browser/content_settings/permission_context_uma_util.h"
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 const GURL& embedding_origin, 174 const GURL& embedding_origin,
175 const BrowserPermissionCallback& callback, 175 const BrowserPermissionCallback& callback,
176 bool persist, 176 bool persist,
177 ContentSetting content_setting) { 177 ContentSetting content_setting) {
178 // Infobar persistance and its related UMA is tracked on the infobar 178 // Infobar persistance and its related UMA is tracked on the infobar
179 // controller directly. 179 // controller directly.
180 if (PermissionBubbleManager::Enabled()) { 180 if (PermissionBubbleManager::Enabled()) {
181 if (persist) { 181 if (persist) {
182 DCHECK(content_setting == CONTENT_SETTING_ALLOW || 182 DCHECK(content_setting == CONTENT_SETTING_ALLOW ||
183 content_setting == CONTENT_SETTING_BLOCK); 183 content_setting == CONTENT_SETTING_BLOCK);
184 if (CONTENT_SETTING_ALLOW) 184 if (content_setting == CONTENT_SETTING_ALLOW)
185 PermissionContextUmaUtil::PermissionGranted(permission_type_, 185 PermissionContextUmaUtil::PermissionGranted(permission_type_,
186 requesting_origin); 186 requesting_origin);
187 else 187 else
188 PermissionContextUmaUtil::PermissionDenied(permission_type_, 188 PermissionContextUmaUtil::PermissionDenied(permission_type_,
189 requesting_origin); 189 requesting_origin);
190 } else { 190 } else {
191 DCHECK_EQ(content_setting, CONTENT_SETTING_DEFAULT); 191 DCHECK_EQ(content_setting, CONTENT_SETTING_DEFAULT);
192 PermissionContextUmaUtil::PermissionDismissed(permission_type_, 192 PermissionContextUmaUtil::PermissionDismissed(permission_type_,
193 requesting_origin); 193 requesting_origin);
194 } 194 }
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 DCHECK_EQ(requesting_origin, requesting_origin.GetOrigin()); 243 DCHECK_EQ(requesting_origin, requesting_origin.GetOrigin());
244 DCHECK_EQ(embedding_origin, embedding_origin.GetOrigin()); 244 DCHECK_EQ(embedding_origin, embedding_origin.GetOrigin());
245 DCHECK(content_setting == CONTENT_SETTING_ALLOW || 245 DCHECK(content_setting == CONTENT_SETTING_ALLOW ||
246 content_setting == CONTENT_SETTING_BLOCK); 246 content_setting == CONTENT_SETTING_BLOCK);
247 247
248 profile_->GetHostContentSettingsMap()->SetContentSetting( 248 profile_->GetHostContentSettingsMap()->SetContentSetting(
249 ContentSettingsPattern::FromURLNoWildcard(requesting_origin), 249 ContentSettingsPattern::FromURLNoWildcard(requesting_origin),
250 ContentSettingsPattern::FromURLNoWildcard(embedding_origin), 250 ContentSettingsPattern::FromURLNoWildcard(embedding_origin),
251 permission_type_, std::string(), content_setting); 251 permission_type_, std::string(), content_setting);
252 } 252 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698