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

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

Issue 2909453002: Support persist toggle in PermissionRequestManager path on Android (Closed)
Patch Set: rebase Created 3 years, 6 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 | « chrome/browser/permissions/permission_util.h ('k') | 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_util.h" 5 #include "chrome/browser/permissions/permission_util.h"
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 #include "base/feature_list.h" 8 #include "base/feature_list.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" 10 #include "chrome/browser/content_settings/host_content_settings_map_factory.h"
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 case CONTENT_SETTINGS_TYPE_PLUGINS: 154 case CONTENT_SETTINGS_TYPE_PLUGINS:
155 #if defined(OS_ANDROID) || defined(OS_CHROMEOS) 155 #if defined(OS_ANDROID) || defined(OS_CHROMEOS)
156 case CONTENT_SETTINGS_TYPE_PROTECTED_MEDIA_IDENTIFIER: 156 case CONTENT_SETTINGS_TYPE_PROTECTED_MEDIA_IDENTIFIER:
157 #endif 157 #endif
158 return true; 158 return true;
159 default: 159 default:
160 return false; 160 return false;
161 } 161 }
162 } 162 }
163 163
164 bool PermissionUtil::ShouldShowPersistenceToggle() { 164 bool PermissionUtil::ShouldShowPersistenceToggle(ContentSettingsType type) {
165 return base::FeatureList::IsEnabled( 165 return (type == CONTENT_SETTINGS_TYPE_GEOLOCATION ||
166 features::kDisplayPersistenceToggleInPermissionPrompts); 166 type == CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC ||
167 type == CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA) &&
168 base::FeatureList::IsEnabled(
169 features::kDisplayPersistenceToggleInPermissionPrompts);
167 } 170 }
168 171
169 PermissionUtil::ScopedRevocationReporter::ScopedRevocationReporter( 172 PermissionUtil::ScopedRevocationReporter::ScopedRevocationReporter(
170 Profile* profile, 173 Profile* profile,
171 const GURL& primary_url, 174 const GURL& primary_url,
172 const GURL& secondary_url, 175 const GURL& secondary_url,
173 ContentSettingsType content_type, 176 ContentSettingsType content_type,
174 PermissionSourceUI source_ui) 177 PermissionSourceUI source_ui)
175 : profile_(profile), 178 : profile_(profile),
176 primary_url_(primary_url), 179 primary_url_(primary_url),
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 return; 212 return;
210 HostContentSettingsMap* settings_map = 213 HostContentSettingsMap* settings_map =
211 HostContentSettingsMapFactory::GetForProfile(profile_); 214 HostContentSettingsMapFactory::GetForProfile(profile_);
212 ContentSetting final_content_setting = settings_map->GetContentSetting( 215 ContentSetting final_content_setting = settings_map->GetContentSetting(
213 primary_url_, secondary_url_, content_type_, std::string()); 216 primary_url_, secondary_url_, content_type_, std::string());
214 if (final_content_setting != CONTENT_SETTING_ALLOW) { 217 if (final_content_setting != CONTENT_SETTING_ALLOW) {
215 PermissionUmaUtil::PermissionRevoked(content_type_, source_ui_, 218 PermissionUmaUtil::PermissionRevoked(content_type_, source_ui_,
216 primary_url_, profile_); 219 primary_url_, profile_);
217 } 220 }
218 } 221 }
OLDNEW
« no previous file with comments | « chrome/browser/permissions/permission_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698