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

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

Issue 1197853005: Collecting statistics on iframe permissions use. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Just rebased. Created 5 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
« no previous file with comments | « no previous file | chrome/browser/permissions/permission_context_uma_util.h » ('j') | 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/permissions/permission_context_base.h" 5 #include "chrome/browser/permissions/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/permissions/permission_bubble_request_impl.h" 9 #include "chrome/browser/permissions/permission_bubble_request_impl.h"
10 #include "chrome/browser/permissions/permission_context_uma_util.h" 10 #include "chrome/browser/permissions/permission_context_uma_util.h"
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 std::string()); 124 std::string());
125 125
126 if (content_setting == CONTENT_SETTING_ALLOW || 126 if (content_setting == CONTENT_SETTING_ALLOW ||
127 content_setting == CONTENT_SETTING_BLOCK) { 127 content_setting == CONTENT_SETTING_BLOCK) {
128 NotifyPermissionSet(id, requesting_origin, embedding_origin, callback, 128 NotifyPermissionSet(id, requesting_origin, embedding_origin, callback,
129 false /* persist */, content_setting); 129 false /* persist */, content_setting);
130 return; 130 return;
131 } 131 }
132 132
133 PermissionContextUmaUtil::PermissionRequested( 133 PermissionContextUmaUtil::PermissionRequested(
134 permission_type_, requesting_origin); 134 permission_type_, requesting_origin, embedding_origin, profile_);
135 135
136 if (PermissionBubbleManager::Enabled()) { 136 if (PermissionBubbleManager::Enabled()) {
137 PermissionBubbleManager* bubble_manager = 137 PermissionBubbleManager* bubble_manager =
138 PermissionBubbleManager::FromWebContents(web_contents); 138 PermissionBubbleManager::FromWebContents(web_contents);
139 // TODO(mlamouri): sometimes |bubble_manager| is null. This check is meant 139 // TODO(mlamouri): sometimes |bubble_manager| is null. This check is meant
140 // to prevent crashes. See bug 457091. 140 // to prevent crashes. See bug 457091.
141 if (!bubble_manager) 141 if (!bubble_manager)
142 return; 142 return;
143 scoped_ptr<PermissionBubbleRequest> request_ptr( 143 scoped_ptr<PermissionBubbleRequest> request_ptr(
144 new PermissionBubbleRequestImpl( 144 new PermissionBubbleRequestImpl(
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 DCHECK_EQ(requesting_origin, requesting_origin.GetOrigin()); 245 DCHECK_EQ(requesting_origin, requesting_origin.GetOrigin());
246 DCHECK_EQ(embedding_origin, embedding_origin.GetOrigin()); 246 DCHECK_EQ(embedding_origin, embedding_origin.GetOrigin());
247 DCHECK(content_setting == CONTENT_SETTING_ALLOW || 247 DCHECK(content_setting == CONTENT_SETTING_ALLOW ||
248 content_setting == CONTENT_SETTING_BLOCK); 248 content_setting == CONTENT_SETTING_BLOCK);
249 249
250 profile_->GetHostContentSettingsMap()->SetContentSetting( 250 profile_->GetHostContentSettingsMap()->SetContentSetting(
251 ContentSettingsPattern::FromURLNoWildcard(requesting_origin), 251 ContentSettingsPattern::FromURLNoWildcard(requesting_origin),
252 ContentSettingsPattern::FromURLNoWildcard(embedding_origin), 252 ContentSettingsPattern::FromURLNoWildcard(embedding_origin),
253 permission_type_, std::string(), content_setting); 253 permission_type_, std::string(), content_setting);
254 } 254 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/permissions/permission_context_uma_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698