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

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

Issue 2339093002: [HBD] Add Plugins permission type and PermissionContext (Closed)
Patch Set: [HBD] Add Plugins permission type and PermissionContext Created 4 years, 3 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 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 "base/feature_list.h" 7 #include "base/feature_list.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" 9 #include "chrome/browser/content_settings/host_content_settings_map_factory.h"
10 #include "chrome/browser/permissions/permission_uma_util.h" 10 #include "chrome/browser/permissions/permission_uma_util.h"
(...skipping 27 matching lines...) Expand all
38 case content::PermissionType::PROTECTED_MEDIA_IDENTIFIER: 38 case content::PermissionType::PROTECTED_MEDIA_IDENTIFIER:
39 return "ProtectedMediaIdentifier"; 39 return "ProtectedMediaIdentifier";
40 case content::PermissionType::AUDIO_CAPTURE: 40 case content::PermissionType::AUDIO_CAPTURE:
41 return "AudioCapture"; 41 return "AudioCapture";
42 case content::PermissionType::VIDEO_CAPTURE: 42 case content::PermissionType::VIDEO_CAPTURE:
43 return "VideoCapture"; 43 return "VideoCapture";
44 case content::PermissionType::MIDI: 44 case content::PermissionType::MIDI:
45 return "Midi"; 45 return "Midi";
46 case content::PermissionType::BACKGROUND_SYNC: 46 case content::PermissionType::BACKGROUND_SYNC:
47 return "BackgroundSync"; 47 return "BackgroundSync";
48 case content::PermissionType::PLUGINS:
49 return "Plugins";
48 case content::PermissionType::NUM: 50 case content::PermissionType::NUM:
49 break; 51 break;
50 } 52 }
51 NOTREACHED(); 53 NOTREACHED();
52 return std::string(); 54 return std::string();
53 } 55 }
54 56
55 bool PermissionUtil::GetPermissionType(ContentSettingsType type, 57 bool PermissionUtil::GetPermissionType(ContentSettingsType type,
56 PermissionType* out) { 58 PermissionType* out) {
57 if (type == CONTENT_SETTINGS_TYPE_GEOLOCATION) { 59 if (type == CONTENT_SETTINGS_TYPE_GEOLOCATION) {
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 ContentSetting final_content_setting = settings_map->GetContentSetting( 131 ContentSetting final_content_setting = settings_map->GetContentSetting(
130 primary_url_, secondary_url_, content_type_, std::string()); 132 primary_url_, secondary_url_, content_type_, std::string());
131 if (final_content_setting != CONTENT_SETTING_ALLOW) { 133 if (final_content_setting != CONTENT_SETTING_ALLOW) {
132 PermissionType permission_type; 134 PermissionType permission_type;
133 if (PermissionUtil::GetPermissionType(content_type_, &permission_type)) { 135 if (PermissionUtil::GetPermissionType(content_type_, &permission_type)) {
134 PermissionUmaUtil::PermissionRevoked(permission_type, source_ui_, 136 PermissionUmaUtil::PermissionRevoked(permission_type, source_ui_,
135 primary_url_, profile_); 137 primary_url_, profile_);
136 } 138 }
137 } 139 }
138 } 140 }
OLDNEW
« no previous file with comments | « chrome/browser/permissions/permission_uma_util.cc ('k') | chrome/browser/plugins/plugins_permission_context.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698