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

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

Issue 2829123003: Make media permission requests go through the PermissionManager (Closed)
Patch Set: Grouped requests Created 3 years, 8 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_request_impl.cc ('k') | chrome/common/chrome_features.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 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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 case CONTENT_SETTINGS_TYPE_NOTIFICATIONS: 87 case CONTENT_SETTINGS_TYPE_NOTIFICATIONS:
88 return PermissionRequestType::PERMISSION_NOTIFICATIONS; 88 return PermissionRequestType::PERMISSION_NOTIFICATIONS;
89 case CONTENT_SETTINGS_TYPE_MIDI_SYSEX: 89 case CONTENT_SETTINGS_TYPE_MIDI_SYSEX:
90 return PermissionRequestType::PERMISSION_MIDI_SYSEX; 90 return PermissionRequestType::PERMISSION_MIDI_SYSEX;
91 case CONTENT_SETTINGS_TYPE_PUSH_MESSAGING: 91 case CONTENT_SETTINGS_TYPE_PUSH_MESSAGING:
92 return PermissionRequestType::PERMISSION_PUSH_MESSAGING; 92 return PermissionRequestType::PERMISSION_PUSH_MESSAGING;
93 case CONTENT_SETTINGS_TYPE_PROTECTED_MEDIA_IDENTIFIER: 93 case CONTENT_SETTINGS_TYPE_PROTECTED_MEDIA_IDENTIFIER:
94 return PermissionRequestType::PERMISSION_PROTECTED_MEDIA_IDENTIFIER; 94 return PermissionRequestType::PERMISSION_PROTECTED_MEDIA_IDENTIFIER;
95 case CONTENT_SETTINGS_TYPE_PLUGINS: 95 case CONTENT_SETTINGS_TYPE_PLUGINS:
96 return PermissionRequestType::PERMISSION_FLASH; 96 return PermissionRequestType::PERMISSION_FLASH;
97 case CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC:
98 return PermissionRequestType::PERMISSION_MEDIASTREAM_MIC;
99 case CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA:
100 return PermissionRequestType::PERMISSION_MEDIASTREAM_CAMERA;
97 default: 101 default:
98 NOTREACHED(); 102 NOTREACHED();
99 return PermissionRequestType::UNKNOWN; 103 return PermissionRequestType::UNKNOWN;
100 } 104 }
101 } 105 }
102 106
103 PermissionRequestGestureType PermissionUtil::GetGestureType(bool user_gesture) { 107 PermissionRequestGestureType PermissionUtil::GetGestureType(bool user_gesture) {
104 return user_gesture ? PermissionRequestGestureType::GESTURE 108 return user_gesture ? PermissionRequestGestureType::GESTURE
105 : PermissionRequestGestureType::NO_GESTURE; 109 : PermissionRequestGestureType::NO_GESTURE;
106 } 110 }
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 return; 209 return;
206 HostContentSettingsMap* settings_map = 210 HostContentSettingsMap* settings_map =
207 HostContentSettingsMapFactory::GetForProfile(profile_); 211 HostContentSettingsMapFactory::GetForProfile(profile_);
208 ContentSetting final_content_setting = settings_map->GetContentSetting( 212 ContentSetting final_content_setting = settings_map->GetContentSetting(
209 primary_url_, secondary_url_, content_type_, std::string()); 213 primary_url_, secondary_url_, content_type_, std::string());
210 if (final_content_setting != CONTENT_SETTING_ALLOW) { 214 if (final_content_setting != CONTENT_SETTING_ALLOW) {
211 PermissionUmaUtil::PermissionRevoked(content_type_, source_ui_, 215 PermissionUmaUtil::PermissionRevoked(content_type_, source_ui_,
212 primary_url_, profile_); 216 primary_url_, profile_);
213 } 217 }
214 } 218 }
OLDNEW
« no previous file with comments | « chrome/browser/permissions/permission_request_impl.cc ('k') | chrome/common/chrome_features.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698