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

Unified Diff: chrome/browser/chrome_content_browser_client.cc

Issue 792173002: Revert of Implement HasPermission() method in PermissionService. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/chrome_content_browser_client.h ('k') | content/browser/permissions/OWNERS » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chrome_content_browser_client.cc
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
index 9343853257cee63237ce55b73095b69ac2b4ec1f..94ccf123f1cf3b36c0ff69183e654a11ee6d6826 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -600,24 +600,6 @@
}
#endif // defined(ENALBE_EXTENSIONS)
-content::PermissionStatus
-ContentSettingToPermissionStatus(ContentSetting setting) {
- switch (setting) {
- case CONTENT_SETTING_ALLOW:
- case CONTENT_SETTING_SESSION_ONLY:
- return content::PERMISSION_STATUS_GRANTED;
- case CONTENT_SETTING_BLOCK:
- return content::PERMISSION_STATUS_DENIED;
- case CONTENT_SETTING_ASK:
- return content::PERMISSION_STATUS_ASK;
- case CONTENT_SETTING_DEFAULT:
- case CONTENT_SETTING_NUM_SETTINGS:
- break;
- }
- NOTREACHED();
- return content::PERMISSION_STATUS_DENIED;
-}
-
} // namespace
namespace chrome {
@@ -1994,49 +1976,6 @@
NOTREACHED() << "Invalid RequestPermission for " << permission;
break;
}
-}
-
-content::PermissionStatus ChromeContentBrowserClient::GetPermissionStatus(
- content::PermissionType permission,
- content::BrowserContext* browser_context,
- const GURL& requesting_origin,
- const GURL& embedding_origin) {
- DCHECK(browser_context);
- Profile* profile = Profile::FromBrowserContext(browser_context);
-
- PermissionContextBase* context = nullptr;
- switch (permission) {
- case content::PERMISSION_MIDI_SYSEX:
- context = MidiPermissionContextFactory::GetForProfile(profile);
- break;
- case content::PERMISSION_NOTIFICATIONS:
-#if defined(ENABLE_NOTIFICATIONS)
- context = DesktopNotificationServiceFactory::GetForProfile(profile);
-#else
- NOTIMPLEMENTED();
-#endif
- break;
- case content::PERMISSION_GEOLOCATION:
- context = GeolocationPermissionContextFactory::GetForProfile(profile);
- break;
- case content::PERMISSION_PROTECTED_MEDIA:
- NOTIMPLEMENTED();
- break;
- case content::PERMISSION_PUSH_MESSAGING:
- context = gcm::PushMessagingPermissionContextFactory::GetForProfile(
- profile);
- break;
- case content::PERMISSION_NUM:
- NOTREACHED() << "Invalid RequestPermission for " << permission;
- break;
- }
-
- ContentSetting result = context
- ? context->GetPermissionStatus(requesting_origin.GetOrigin(),
- embedding_origin.GetOrigin())
- : CONTENT_SETTING_DEFAULT;
-
- return ContentSettingToPermissionStatus(result);
}
void ChromeContentBrowserClient::CancelPermissionRequest(
« no previous file with comments | « chrome/browser/chrome_content_browser_client.h ('k') | content/browser/permissions/OWNERS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698